parse the directories