Added load_trajectory function.