Create the get_waypoint function