switched to using mktemp instead of the deprecated tempfile
changed to copying the tsv files using sftp to fix memory problems with large files