Code for thermostat project for SWE 321.