removed inline to too big functions, fixed quaternions structure