only call make_matrix once so faster