Updated shortest path with second destination parameter