changes to ShortestPath