private void toggleFlag()
 {
     if (gameController.getGameStarted())
     {
         if (isFlagged)
         {
             isFlagged = false;
             gameController.decrementNumFlags();
             matRenderer.material = unopenedMat;
             if (!isMine)
             {
                 gameController.removeFromWrongFlagsList(gameObject);
             }
             for (int i = 0; i < 9; i++)
             {
                 int searchX = x + ((i % 3) - 1);
                 int searchY = y + ((i / 3) - 1);
                 if ((searchX != x || searchY != y) &&
                     searchX > 0 && searchY > 0 &&
                     searchX <= gameController.getWidth() &&
                     searchY <= gameController.getHeight())
                 {
                     gameController.getGameCubes()[searchX - 1, searchY - 1].GetComponent <gameCubeCatchController>().decrementFlagNum();
                 }
             }
         }
         else
         {
             isFlagged = true;
             gameController.incrementNumFlags();
             matRenderer.material = flaggedMat;
             if (!isMine)
             {
                 gameController.addToWrongFlagsList(gameObject);
             }
             for (int i = 0; i < 9; i++)
             {
                 int searchX = x + ((i % 3) - 1);
                 int searchY = y + ((i / 3) - 1);
                 if ((searchX != x || searchY != y) &&
                     searchX > 0 && searchY > 0 &&
                     searchX <= gameController.getWidth() &&
                     searchY <= gameController.getHeight())
                 {
                     gameController.getGameCubes()[searchX - 1, searchY - 1].GetComponent <gameCubeCatchController>().incrementFlagNum();
                 }
             }
         }
     }
 }