change the rotation function.