need to modify to somehow take in and sort all directories in the top directory.