corrected HVAC logic