Abstracted the pressure calculations to c++