private boolean isValid(int[][] puzzle, int number, int row, int col){
		
		//if the number is 0 it means it will be an empty box, so no need to check it.
				if(number == 0 || number > 9){	
					return true;
				}
				//check the column
				for(int k=0; k<9; k++){
					if(puzzle[row][k] == number)
						return false;
				}
				
				//check the row
				for(int k=0; k<9; k++){
					if(puzzle[k][col] == number)
						return false;
				}
				
				//check the box
				int boxNumCol = (col/3) * 3;	//trying to find the 3x3 box which our small box belongs to
				int boxNumRow = (row/3) * 3;
				
				for (int k = boxNumRow; k<boxNumRow + 3; k++){
					for (int m = boxNumCol; m<boxNumCol + 3; m++){
						if(puzzle[k][m] == number)
							return false;
					}
				}
				return true;
	}