implementation of waypoint method