switched listFilesRecursive to return list and removed some extra iteration