Rewrote leg kinematics