load and save trajectories