Rewrote estimate_new_T in Tf_loop.py