   if (alarmButtonPushed()) setAlarmState();
   else if (timeButtonPushed()) setTimeState();
   else if (offButtonPushed()) turnOffLightsDueToOffButton();
-  else if (rotaryButtonPushed()) setSunSetState();
+  else if (rotaryButtonPushed()) setSunsetState();
 
   processAlarmMasterSwitch();
   updateAlarmLight();

}


bool alarmButtonPushed()
{
  return (digitalRead(AlarmButton) == LOW && debounceDigitalRead(AlarmButton) == LOW);
}

bool timeButtonPushed()
{
  return (digitalRead(TimeButton) == LOW && debounceDigitalRead(TimeButton) == LOW);
}
bool offButtonPushed()
{
  return (digitalRead(OffButton) == HIGH && debounceDigitalRead(OffButton) == HIGH);
}

bool rotaryButtonPushed()
{
  return (digitalRead(RotaryButton) == LOW && debounceDigitalRead(RotaryButton) == LOW);
}

void turnOffLightsDueToOffButton()
{

  analogWrite(TimeLED, matrixBrightness * 255 / 16 + 15);
  display_Cloc();
  delay(1000);
  waitForButtonDepress(TimeButton, LOW);
}

void changeState_setTime_to_Clock()
{
  updateCurrentTime(true);
  digitalWrite(TimeLED, LOW);
}

void setTimeState() {
  changeState_Clock_to_setTime();

  DateTime currentTime = RTC.now();
  ClockTime t(currentTime);
  updateTimeDisplay(t, true, alarmMasterSwitchEnabled);
  
  uint32_t modeActive = millis();
  bool normalExit = true;
