Getting the pressure and temp properly. Missing generalization of the code