traverseNode should be using index looping rather than key looping.