Better previous mouse position calculation.
New rotation functions.