fixing pressure clamping by writing unit tests