added get_matrix