FIXED: small bug, Tmax referenced before use