Adding write_trajectory to opt subclass of outputfile