Added gen_flatfile.