separated the pressure_leakage_at_t function into smaller functions