updating TrinaryTree