Rotation loop by Raphael Garnier