         // The player was incorrect; subtract a life.
         } else {
 
-            // Turn on the next red LED.
-            if (lives == TOTAL_LIVES) digitalWrite(RED_1, HIGH);
-            else if (lives == TOTAL_LIVES - 1) digitalWrite(RED_2, HIGH);
-            else if (lives == TOTAL_LIVES - 2) digitalWrite(RED_3, HIGH);
-            delay(LIGHT_DELAY);
-
             // Remove a life from the current total.
             lives--;
+
+            // Turn on the next red LED.
+            if (lives == TOTAL_LIVES - 1) digitalWrite(RED_1, HIGH);
+            else if (lives == TOTAL_LIVES - 2) digitalWrite(RED_2, HIGH);
+            else if (lives == TOTAL_LIVES - 3) digitalWrite(RED_3, HIGH);
+            delay(LIGHT_DELAY);
         }
     }
 }



/**
 * Checks the switches and determines if the game should start.
 */
boolean signalGameStart() {

    // Check the tilt switch and buttons for a new game.
    if (digitalRead(TILT) || (!gameStart && analogRead(BUTTONS) > 3)) {
        gameStart = true;
    }

    // Flash all LEDs to signal game start if appropriate.
    if (gameStart) {

        // Blink all lights twice.
        for (int j = 0; j < 2; j++) {
            for (int k = 0; k < QTY; k++) {
                digitalWrite(LEDS[k], HIGH);
            }
            delay(LIGHT_DELAY);
            for (int k = 0; k < QTY; k++) {
                digitalWrite(LEDS[k], LOW);
            }
            delay(LIGHT_DELAY * 2);
        }

        // Signal game start.
        return true;
    }

    // The game has not begun.
    return false;
}



        // Check player input.
        if (verifyPlayerInput(pattern, currentLevel)) {

            // Check for game reset.
            if (digitalRead(TILT)) {
                gameStart = false;
                signalGameChange(1);
                return;
            }

            // The player was correct; move to the next level.
            currentLevel++;
            delay(GAME_SPEED);
