implementing switch led and heating logic