shortest path working basically will look at cleaning up and adding checks