finished most of the quaternion implementation