Old change for making code clear. Made changes for filtering the directories. Made traversal much faster