           else if (addScore == 0) addScore = -1;
           else if (addScore == -1) addScore = -10;
           else if (addScore == -10) addScore = -100;
-          else if (addScore == -100) addScore = -1000;
+          else if (addScore == -100) {
+            // The game has been won
+            totalScore = -1000;
+            goto gameWon;
+          }
         }
         // Move to next position in group of 4
         j += lineStep;

    dropCounter(board, 'X', best);
    displayBoard(board);
    
    if (score(board, 'X', 'O') > 500) {
      Serial.println();
      Serial.println ("****COMISERATIONS YOU LOST****");
      Serial.println();

          else if (addScore == 0) addScore = 1;
          else if (addScore == 1) addScore = 10;
          else if (addScore == 10) addScore = 100;
          else if (addScore == 100) {
            // The game has been won
            totalScore = 1000;
            goto gameWon;
          }
        }
  
        if (board[j] == oppToken) {
