latest version with GetEntryType() in VarClass::buildTree; to be rewritten