Modify to handle sub-directories.