Updated to have multiple trajectories