implemented CodeTree.weight
implemented CodeTree.chars