   }
   else // Execute control algorithm
   {
+    Serial.println("computing PID");
      myPID.Compute();
   }
   
   // Time Proportional relay state is updated regularly via timer interrupt.
-  onTime = Output;
   Serial.println("output time on setpoint: " + String(Output));
   Serial.print("now - windowStartTime: ");
-  Serial.println(now - windowStartTime);
+  Serial.println(millis() - windowStartTime);
+  Serial.print("setpoint: ");
+  Serial.println(Setpoint);
 }
 
 void StartAutoTune()

void loop(void) {
  
  Serial.println("temp: " + String(Input) + " C");
  if (!alreadyTuned and !tuning)
  {
    StartAutoTune();
  }

   // Initialize the PID and related variables
   LoadParameters();
   myPID.SetTunings(Kp,Ki,Kd);
   Serial.print("Kp: ");
   Serial.println(Kp);
   Serial.print("Ki: ");
   Serial.println(Ki);
   Serial.print("Kd: ");
   Serial.println(Kd);
  
   myPID.SetSampleTime(1000);
   myPID.SetOutputLimits(0, WindowSize);
