   if ( button == BUTTON_RESTART ) {
     start_countdown_timer();
   } else if ( button == BUTTON_MODE ) {
-    change_to_waiting_state();
+    change_to_state(STATE_WAITING);
   } else if ( button == BUTTON_PLUS ) {
     countdown_ends += ONE_MINUTE;
-    current_state = STATE_RUNNING;
+    change_to_state(STATE_RUNNING);
   } else if ( button == BUTTON_MINUS ) {
     long time_remaining = countdown_ends - millis();
     if ( time_remaining > ONE_MINUTE ) {
       countdown_ends -= ONE_MINUTE;
-      current_state = STATE_RUNNING;
+      change_to_state(STATE_RUNNING);
     }
   }
 }


void start_countdown_timer () {
  countdown_ends = millis() + countdown_duration + 300;
  current_state = STATE_RUNNING;
}

void running_state_loop (int button) {

}


void change_to_state(int new_state) {
  if (new_state == STATE_WAITING) {
    current_state = STATE_WAITING;
  } else if (new_state == STATE_RUNNING) {
    current_state = STATE_RUNNING;
  } else if (new_state == STATE_PULSING) {
    current_state = STATE_PULSING;
  } else if (new_state == STATE_MODE) {
    Serial.println("FIXME - code up change_to_state(STATE_MODE)");
    change_to_state(STATE_WAITING);
  }
}

void waiting_state_loop (int button) {
