A TreeNode class helper
old solutions