fixed the calulation of the rotation, the value can now be larger than the range and the value can be less than the min value