added optional argument to specify number of files to transfer at a time.