Add 'fill_directory()' helper function for directory traversal