avoid using np.mat