written code for the shortest shortest path.
TODO