relocated declaration of rotation matrix