fixed quaternion orientation code