 // Used for light sensor
 int LightCurrent          = 0;             // Current reading
 int LightLast             = LightCurrent;  // Last reading
-int LightThreshUp         = 400;
-int LightThreshDown       = 100;
+int LightThreshUp         = 400;           // Light threshold above which we open door
+int LightThreshDown       = 100;           // Light threshold below which we close door
 int LightThreshTicks      = 0;             // Ticks needed to start door position change
 // Used for clock
 DateTime Now;
-TimeSpan ClockThreshUp;
-TimeSpan ClockThreshDown;
-// Is motor enabled or not
-bool MotorEnabled;
+TimeSpan ClockThreshUp;                    // Time above which we open door
+TimeSpan ClockThreshDown;                  // Time below which we close door
+// Used for motor 
+bool MotorEnabled;                         // Is motor enabled or not?
 
 // Initialize the LCD
 LiquidCrystal Lcd(PIN_LCD_RS, PIN_LCD_ENABLE, PIN_LCD_D4, PIN_LCD_D5, PIN_LCD_D6, PIN_LCD_D7);

  return ( LightThreshTicks / (float) LIGHT_THRESH_TICKS_TO_CHANGE ) * 10;
}

int32_t totalseconds(DateTime timestamp) {
  return ( (int32_t)timestamp.hour() * 3600 ) + ( (int32_t)timestamp.minute() * 60 ) + timestamp.second();
}

bool between(TimeSpan low, DateTime middle, TimeSpan high) {
  return high.totalseconds() < totalseconds(middle) < high.totalseconds();
}

/**
 * Writes debug info to serial

      // Ambiguous. Close when light says to open, but clock says to close. Prevents door staying open if light sensor is faulty.
      ( LightCurrent > LightThreshUp && LightCurrent > LightThreshDown && totalseconds(Now) < ClockThreshUp.totalseconds() && totalseconds(Now) < ClockThreshDown.totalseconds() )
    )
  )
  { // We should close
    LightThreshTicks++;
    updateLCD();
    if ( LightThreshTicks > LIGHT_THRESH_TICKS_TO_CHANGE ) {
