small modification for slicing off array members in generateCharTree()