working on quaternion and matrix