Added option to allow user to set target file name and directory.