This is working somewhat. Getting stack overflows. Added in traversals for trees.
Minor changes.