demo code for waypoints