Shortest routes function developed, lots of bugs found in route calculation.