Bug fixing

fixed a bug in the code for converting a rotation matrix into a
quaterninon