new rotation tracking function