Fiddled around with get_Th_inf. The tolerance doesn't need to be that high, in favor of speed.