changed all the node types to TNode