public ArrayList<ASPoint> calculate() {
		ArrayList<ASPoint> path = null;
		try {
		//STARTING THE PROCESS
		//1. Begin at starting point A...
		Node sNode = new Node(start.x, start.y);
		sNode.G = 0;
		calculateH(sNode);
		calculateF(sNode);
		addToOpenList(sNode);
		//2. Look at all the reachable or walkable...
		checkAdjacentNodesStart(sNode);
		//3. Drop the starting square A...
		removeFromOpenList(sNode);
		addToClosedList(sNode);
				
		Node fNode = new Node(finish.x, finish.y);
		Node breakNode = null;
		do {
		//CONTINUING THE PROCESS
		//Next, we choose one of the adjacent squares on the open list and more or less repeat the earlier process...
		//To continue the search, we simply choose the lowest F score square...
		Node chosen = getLowestFNode();
		if (chosen == null) {
			return null;
		}
		
		//4. Drop it from the open list and add it to the closed list...
		removeFromOpenList(chosen);
		addToClosedList(chosen);
		checkAdjacentNodes(chosen);
		
		Tile t = MyzoGEN.getOutput().getTile(new Point(chosen.x, chosen.y));
		if (t != null) {
			if (t.tile == Tiles.WATER && t.riverID != riverID || (chosen.x == 0 || chosen.y == 0 || chosen.x == width-1 || chosen.y == height-1)) {
				breakNode = chosen;
				break;
			}
		}
		
		} while (!isInClosedArray(fNode));
		
		if (breakNode != null)
			path = getPath(breakNode.x, breakNode.y);
		else
			path = getPath(fNode.x, fNode.y);
		} catch (Exception e) {e.printStackTrace();}
		return path;
	}