private int getNextValidNumber(int[][] game, int x, int y, List<Integer> listOfNumbers) {
        while (listOfNumbers.size() > 0) {
            //remove the first element from the list and assign to variable
            int num = listOfNumbers.remove(0);
            
            //check if num exists in row, column, and 3x3 block
            //return the num if it does not exist
            if (isValidRow(game, y, num) && isValidColumn(game, x, num) && isValidBlock(game, x, y, num))
                return num;
        }
        return -1;
    }