optimised the performance of setting the center of mass to the origin