changing the rotation function