private Node[] Path(Node destination, Node start) { LinkedList<Node> nodes = new LinkedList<Node>(); Node node = destination; while (!start.Equals(destination)) { nodes.AddFirst(new Node(node.X, node.Y)); if (node.previous == null) { break; } node = node.previous; } return nodes.ToArray(); }