implemented WordTree and TreeNode