Added comments to find the shortest path