implemented thermostat descrete