updated retrieve files to download logic.  Now returns a list of files to download