changed to automatically go over the files for each sample