added genTrajectories