Added proper quaternion average to rotations and paintGrid