Updated listing function to include sub-directories.