edit def emit_matrix()