         changedUIString = true;               //*** this block becomes unreachable after this, because this true value is remembered
       }
 
-      unsigned long secondsLeft = (countdown - (millis() - spinningStartTime))/1000;  //*** save RAM AND flash memory by only doing this calculation once per case in loop()
+      unsigned long secondsLeft = (setDuration - (millis() - spinningStartTime))/1000;  //*** save RAM AND flash memory by only doing this calculation once per case in loop()
       analogWrite(MOTOR_PIN, motorSpeed);
 
       lcd.setCursor(13, 1);

const uint8_t POT_PIN = A5;


//*** No magic numbers! Using case statements, enum will provide readable, self-documenting code for when switching modes
enum class Mode
{
  SETTING_TIME,

                                                      //    their values persist even after function ends, as long as the program is still running
                                                      //*** also, static local variables still only have local scope
                                                      //*** perform operations with data of the same type, so as to boost performance by not needing to typecast
  static unsigned long setDuration;                     // the duration that the centrifuge should run
  static unsigned long spinningStartTime;             // point on the timeline where the countdown starts, i.e. when wpb is pressed the second time
  static uint8_t motorSpeed;

