almost done with dijkstra