Moved matrix rotations to the right module