public int heuristic(Node n)
	{
		int total = 0;
		for(int i = 1; i <= 3; i++)
		{
			int current = -1;
			int goalstate = -1;
			for(int z = 0; z < n.getState().getState().length; z++)
			{
				if(n.getState().getState()[z] == i) 
				{ current = z; break; }
			}

			for(int z = 0; z < finalState.getState().length; z++)
			{
				if(finalState.getState()[z] == i) { goalstate = z; break; }
			}


			int currentx = current % width;
			int currenty = (int) Math.floor(current/width);



			int goalx = goalstate % width;
			int goaly = (int) Math.floor(goalstate/width);


			total += Math.abs(currentx-goalx ) + Math.abs(currenty - goaly);


		}
		return total;
	}