Using ChickenBone's code for Quaternion and Rotation