replaced `M` with `data_matrix`