 
 		while (top != nil) {
 			path.insert(top!, at: 0)
-			top = top?.parentNode
+			top = top!.parentNode
 		}
 
 		self.resetElements()


				if (current.ID == dest.ID) { continue }

				if dest.pathCost != nil &&
				   dest.pathCost! <= (current.pathCost ?? 0) + e.cost
				{ continue }

				dest.pathCost = (current.pathCost ?? 0) + e.cost
				dest.parentNode = current
				queue.append(dest)
			}

		}

		var top : Node? = to


public class Graph {

	private var edges: [Edge]
	private let processingLock = NSLock()

	public init(edges: [Edge]) {
