Added code to iterate over directory and sub directories