some changes to rotate