public static String getPath(int startX, int startY, int endX, int endY, TileGrid grid) {
		String out = "";
		openList = new ArrayList<Node>();
		closedList = new ArrayList<Node>();
		openList.add(new Node(grid.getTile(startX, startY),null));
		Pathfinder.endX = endX;
		Pathfinder.endY = endY;
		
		Node goalNode = new Node(grid.getTile(endX, endY),null);
		Node currentNode;
		
		System.out.println("Start: " + startX + " " + startY + " End: " + endX + " " + endY);
		
		while(true) {
			currentNode = getBestNode(openList);
			if (currentNode == null) System.out.println("Pathfinder: current node is NULL");
			if (currentNode.equals(goalNode)) {
				break;
			}
			openList.remove(currentNode);
			closedList.add(currentNode);
			
			//N
			if (grid.getTile(currentNode.tile.x,currentNode.tile.y-1) != null) {
				Node newNode = new Node(grid.getTile(currentNode.tile.x,currentNode.tile.y-1),currentNode);
				checkNode(newNode);	
			}
			//E
			if (grid.getTile(currentNode.tile.x+1,currentNode.tile.y) != null) {
				Node newNode = new Node(grid.getTile(currentNode.tile.x+1,currentNode.tile.y),currentNode);
				checkNode(newNode);
			}
			//S
			if (grid.getTile(currentNode.tile.x,currentNode.tile.y+1) != null) {
				Node newNode = new Node(grid.getTile(currentNode.tile.x,currentNode.tile.y+1),currentNode);
				checkNode(newNode);
			}
			//W
			if (grid.getTile(currentNode.tile.x-1,currentNode.tile.y) != null) {
				Node newNode = new Node(grid.getTile(currentNode.tile.x-1,currentNode.tile.y),currentNode);
				checkNode(newNode);
			}
		}
		while(currentNode.parent != null) {
			out += currentNode.parentDirection();
			currentNode = currentNode.parent;
		}
		
		String reversedOut = "";
		for (int i = out.length() - 1; i >= 0; i--) {
			reversedOut += out.charAt(i);
		}
		
		System.out.println("Path: " + reversedOut);
		
		
		
		return(reversedOut);
	}