trying to use map instead of slice for Files and Directories