Use anonymous function to create appropriate scope to deal with highly nested variables. Allows for file/directory tests with accurate responses as to the file/directory being tested