Coding the route from A to B