Fixing get_trajectory