   else if (digitalRead(TimeButton)==LOW && debounceDigitalRead(TimeButton)==LOW) {
     setTime();
   } 
-//  else if (digitalRead(OffButton)==HIGH && debounceDigitalRead(OffButton)==HIGH) {
-//    if (alarmActive) {
-//      alarmActive = false;
-//      alarmEnabled = false;
-//      turnLightOff(lastAlarmLightLevel);
-//      waitForButtonDepress(OffButton);
-//    } 
-//    else if (sunSetActive) {
-//      sunSetActive = false;
-//      turnLightOff(lastSunSetLightLevel);
-//      waitForButtonDepress(OffButton);
-//    }
-//    else {
-//      setSunSet();
-//    }
-//  } 
+  else if (digitalRead(OffButton)==HIGH && debounceDigitalRead(OffButton)==HIGH) {
+    if (alarmActive) {
+      alarmActive = false;
+      alarmEnabled = false;
+      turnLightOff(lastAlarmLightLevel);
+      waitForButtonDepress(OffButton);
+    } 
+    else if (sunSetActive) {
+      sunSetActive = false;
+      turnLightOff(lastSunSetLightLevel);
+      waitForButtonDepress(OffButton);
+    }
+    else {
+      setSunSet();
+    }
+  } 
   updateBrightness();
 //  updateLight();
   updateCurrentTime();

  return !(lhs == rhs);
}

ClickEncoder *encoder;
#define ENCODER_PIN0 11
#define ENCODER_PIN1 12

//const int LEDpinA = 6;

const int AlarmButton = 7;
const int AlarmLED = 8;

  finalMillis *= 1000;
  if (delta > finalMillis) {
    sunSetActive = false;
    linearBrightOfStep(0);
  }
  else {
    double temp = -(1800.0*delta)/(finalMillis*1.0) + 1800.0;
    linearBrightOfMilliseconds(temp);
  }
}

