def get_common_ancestor(self, lnode, rnode, stop=None):
        stop = stop or self.root
        if lnode is rnode:
            return lnode
        if stop in (lnode, rnode):
            return stop

        if not hasattr(lnode, 'parent') or not hasattr(rnode, 'parent'):
            return
        if (lnode.level > rnode.level):
            return self.get_common_ancestor(lnode.parent, rnode, stop)
        if (rnode.level > lnode.level):
            return self.get_common_ancestor(lnode, rnode.parent, stop)
        return self.get_common_ancestor(lnode.parent, rnode.parent, stop)