ExtendedDijkstra improved and corrected