updated computeShortestPath