Tidied up main.c, added control logic for heater