correct dijkstra's, pending optimization