Calculating pressure and volume