added code to get all files in the folder and save the list to a file