functional version for all htmls in a folder