working on recursive traversal