Added some code to change input/output file.