Added some things needed to control thermal iteration and time loop.