   
   
   
-  // ******* Rival turn *******
+  // ************************************************************************
+  // ******* Rival turn *****************************************************
+  // ************************************************************************
+  printMsg("Wait for your rival's move.");
+  
   // Check rival move, wait until it happens
+  waitForMove = true;
+  int rival_move = -1;
+  while(waitForMove){
+    rival_move = getMove();
+    // Wait and check again
+    if (rival_move < 0){
+      delay(100);
+    } else{
+      waitForMove = false;    
+    }
+  }  
   // Update color status
+  if (rival_move > -1 && rival_move  < 9){
+    redStatus[rival_move] = 1;
+    squares[rival_move]->setRed();
+  }
+  
   // Check victory conditions
-  
-  
-  
-  
-  int rivalMove = getMove();
-  redStatus[rivalMove] = 1;
-  
-  if (!redVictory && !greenVictory){
-    updateColorStatus();
-  }
-  
-  
   redVictory = checkWin(redStatus);
-  greenVictory = checkWin(greenStatus);
- 
   if (redVictory){
+    printMsg("You lose!"); 
     victoryLoop('r');
-  } else if (greenVictory){
-    victoryLoop('g');
-  }
-  
-
+  }
 }
 
 /**********************************************

void sendMove(int player_move){
  //TODO
  // send ("MOVE " + player_move + player_id)
  return 0;
}



/**********************************************
 *   GAME LOGIC
 **********************************************/

// -1 -> no move
// -2 -> illegal move, 2 pieces moved
// -3 -> illegal move, moved into a square used by the rival
// 0..8 -> legal move
int checkPlayerMove(){
  int totalMoves = 0;
  int player_move = 0;
