public synchronized int[] makeMove(Scanner stdin, String play) {
        int r;
        int c;
        int[] a = null;
        Boolean goodInput = false;
        while(!goodInput) {
            r = -1;
            c = -1;
            System.out.println ("Enter coordinates to play your " + play);
            if (stdin.hasNextInt()) {  // must be integers
                r = stdin.nextInt();
            }
            if (stdin.hasNextInt()) {
                c = stdin.nextInt();
            }
            else {
                stdin.nextLine();      // consume a line without an integer
                System.out.println("Both inputs must be integers between 0 and 2.");
                continue;
            }
            // must be in the right coordinate range
            if ((r < 0) || (r > 2) || (c < 0) || (c > 2)) {
                System.out.println("Both inputs must be integers between 0 and 2.");
                continue;                
            } 
            // make sure the space is not occupied
            else if (board[r][c] != null ){  
                System.out.println("That location is occupied");
                continue; 
            }
            else {
                board[r][c] = play;
                a = new int[2];
                a[0]=r;
                a[1]=c;
                return a;
            }
        }
        return a;
    }