Updated new dijkstra implementation to produce the same output as the other versions.