     }
     strip.show();
     
-    // button 1 may still be pressed since the code gets here very fast
+    // button 3 may still be pressed since the code gets here very fast
     // if button 1 is pressed, wait will the user releases it
-    while (button2State == HIGH) {
+    while (button3State == HIGH) {
         // do nothing, we need to wait until user releases the button
-        button2State = digitalRead(button2Pin);
+        button3State = digitalRead(button3Pin);
     }
     
     // button 2 is used to exit the LED count set mode
-    while (button3State == LOW) {
+    while (button2State == LOW) {
         button2State = digitalRead(button2Pin);
         button3State = digitalRead(button3Pin);
         increment_LED_count = false;
         
-        if (button2State == HIGH) {
+        if (button3State == HIGH) {
             increment_LED_count = true;
         }
         
-        while (button2State == HIGH) {
+        while (button3State == HIGH) {
             // do nothing, we need to wait until user releases the button
-            button2State = digitalRead(button2Pin);
+            button3State = digitalRead(button3Pin);
         }
         
         if (increment_LED_count) {

    set_LED_count_mode = false;
}

void loop() {
    // check for LED count mode
    if (set_LED_count_mode == true) {

    pinMode(button3Pin, INPUT);
    
    // check for button press to enter LED count set mode
    button3State = digitalRead(button3Pin);
    
    if (button3State == HIGH) {
        set_LED_count_mode = true;
    }
    
