Added rot_m to rotate v to e_m

Code cleanup in other places