added boolean methods isLeaf, isRoot