protected int checkSolutions(int x, int y, int[][] sudoku,
			int solutionsFound, int maxRecursionDepth) {
		/*
		 * If all columns in a row have been filled increase the number of rows.
		 */
		if (x == this.sudokuSize) {
			x = 0;
			if (++y == this.sudokuSize) {
				/*
				 * If all cells have been filled, another solution has been
				 * found.
				 */
				return 1 + solutionsFound;
			}
		}
		/*
		 * If the maximum depth is reached, return 2 (as is likely to have more
		 * than one solution, or maybe none at all).
		 */
		if (maxRecursionDepth == 0) {
			return 2;
		}

		/*
		 * Skip filled cells by increasing the x value and making a recursive
		 * call
		 */
		if (sudoku[x][y] != 0) {
			return checkSolutions(x + 1, y, sudoku, solutionsFound,
					maxRecursionDepth--);
		}

		/*
		 * Fill every legal value from 1 to 9 in the cell and try to find
		 * solutions recursively. Break the loop if there is already more than 1
		 * solution.
		 */
		for (int val = 1; val <= this.sudokuSize && solutionsFound < 2; ++val) {
			if (legal(x, y, val, sudoku)) {
				sudoku[x][y] = val;
				solutionsFound = checkSolutions(x + 1, y, sudoku,
						solutionsFound, maxRecursionDepth--);
			}
		}
		/*
		 * Finding a solution was not successful, reset on backtrack and return
		 * the number of solutions found so far.
		 */
		sudoku[x][y] = 0;
		return solutionsFound;
	}