added set_matrix