fixed bug where shortest path returns unordered path of nodes