public PuzzleState readFromFile(String pathToFile, int boardSize) {
		PuzzleState puzzleState = null;
		File inputFile = new File(pathToFile);
		BufferedReader br = null;
		Node puzzleBoard[][] = new Node[boardSize][boardSize];
		Node sortedValues[] = new Node[boardSize * boardSize];
		Node zeroNode = null;
		if(inputFile.isFile()) {
			try {
				br = new BufferedReader(new FileReader(inputFile));
				String line;
				int i = 0;
				while ((line = br.readLine()) != null) {
					String numbers[] = line.split("\t");
					int j = 0;
					for(String number: numbers) {
						if(number.matches("\\d+")) {
							int thisValue = Integer.parseInt(number);
							Node thisNode = new Node(i, j, thisValue);
							puzzleBoard[i][j] = thisNode;
							if(thisValue == 0) {
								zeroNode = thisNode;
							}
							if(thisValue < boardSize * boardSize)
								sortedValues[thisValue] = thisNode;
						}
						j++;
					}
					i++;
				}
			}
			catch(Exception e) {
				e.printStackTrace();
			} 
			finally {
				if(br != null) {
					try {
						br.close();
					} catch (IOException e) {
						// TODO Auto-generated catch block
						e.printStackTrace();
					}
				}
			}
			 
		}
		else {
			System.err.println("The input file does not exist");
			puzzleState = null;
			System.exit(0);
		}
		puzzleState = new PuzzleState(puzzleBoard, zeroNode);
		puzzleState.setSortedValues(sortedValues);
		return puzzleState;
	}