added infile->outfile support