change outfile extension to reflect output format