public int solve() {
		startTime = System.currentTimeMillis();
		if (solns.size() >= MAX_SOLUTIONS) return 0;
		if (emptySpots.isEmpty()) {
			this.solns.add(grid);
			return 1;
		} else {
			Spot sp = emptySpots.get(0);
			ArrayList<Integer> cand = sp.getCandidates();
			if (cand.isEmpty()) {
				endTime = System.currentTimeMillis();
				return 0;
			}else {	
//				int val = cand.get(0);
				
				for (int i = 0; i < cand.size(); i++){
					int[][] nextGrid = new int[SIZE][SIZE];
					copyGrid(nextGrid, grid);
					nextGrid[sp.row][sp.col] = cand.get(i); 
					Sudoku nextSudoku = new Sudoku(nextGrid);
					nextSudoku.solns = this.solns;
					count += nextSudoku.solve();
				}
			}			
		}
		endTime = System.currentTimeMillis();
		return count;
	}