add filename option to generateWaypointsFile function