dijkstra tested and modified