updated algorithm to only grab files from latest provide folders