added shortest path routine