implemented discrete thermostat