   unsigned long timeLeftMillis = goalTime - millis();
 
   if (millis() > goalTime) {
-    goalTime = millis() + (timeGoalMinutes * 1000L * 60);
-    timeLeftMillis = goalTime;
+    state = AT_ZERO;
+    return;
   }
 
 

unsigned long goalTime = 0;
unsigned long startedSettingTimeGoalMillis = 0;

SoftwareSerial s7s(SOFTWARE_RX, SOFTWARE_TX);

void setup() {
  State state = COUNTING_DOWN;

  s7s.begin(9600);
  s7s.write(0x76);  // Clear display
  s7s.write(0x77);
  s7s.write(1<<COLON);

  q.setup();
  pinMode(INPUT_PIN_INCR, INPUT_PULLUP);
  pinMode(INPUT_PIN_DECR, INPUT_PULLUP);

  timeGoalMinutes = EEPROM.read(timerGoalAddr);
  timeGoalMinutes = 1;
  goalTime = millis() + (timeGoalMinutes * 1000L * 60);
}

void readGoalAdjustment() {
  int incrVal = digitalRead(INPUT_PIN_INCR);
  int decrVal = digitalRead(INPUT_PIN_DECR);
  if (incrVal == HIGH || decrVal == HIGH) {
    q.setRGB(PURPLE);
  }
  if (incrVal == LOW || decrVal == LOW) {
    state = SETTING_TIME_GOAL;
    startedSettingTimeGoalMillis = millis();
    q.setRGB(YELLOW);
  }

  if (incrVal == LOW) {
    timeGoalMinutes++;
  }

  if (decrVal == LOW) {
    timeGoalMinutes--;
  }

  EEPROM.write(timerGoalAddr, timeGoalMinutes);
}


}

void resetTime() {
  goalTime = millis() + (timeGoalMinutes * 1000L * 60);
}

void displayTimeGoal() {
  sprintf(tempString, "%4d", timeGoalMinutes);
  s7s.print(tempString);
}

void displayDashes() {
  sprintf(tempString, "----");
  s7s.print(tempString);
}

