Added file output for trajectories