debugging get_matrix()