output_list factored out