Help with IF and Else

horace:
I assumed the two if() statements were to give some Hysteresis in the ON/OFF control otherwise you could get the LED flickering on/off around the 21degree temperature set point

That is true so that would work if that is what is intended.. and you could tighten it up if you wanted less than a degree of hysteresis.