Ah.. You declared your heat function -inside- your loop function. Maybe things have changed, but in my day I never saw stuff like that. Try moving your heat function up above your start function? Then call it from your loop function when you want it.
-jim lee