Modified to copy infiles to tempory directory and work on files from there.