trying not to use 'is_leaf' since it is new to treelib and doesn't appear in all versions