Solved Shortest Path Problem II with BFS