Truly working drive code. Changed axes for magn and rot