Added a parameter for where to put the output files