Quaternion function added