added normalization for quaternions