changed to dot product in MRPswitch and added cayley