Simplified the get_directory function. Utilizes the -a flag.