result_file is optional