use a more efficient tuple instead of a dict for tree nodes