add matrix_generation for waypoints