convert findFiles into functional