Refactored print_directory() to be its own fucntion