calculating distance and time of the route