new tree traversal that counts the number of times each symbol is seen
found some more special forms, and a way to check for them