Loop the trajectory - first version