add output_file method