optimize the route