Fixed rotation function. Successful test on Asctec