cartesian traj gen: many fixes, working