Insert a node in-place. It is highly suggested that you do not
        use this method. Use assoc instead

def insert(self, index, value):
        '''Insert a node in-place. It is highly suggested that you do not
        use this method. Use assoc instead'''
        newnode = LookupTreeNode(index, value)
        level = 0
        node = self.root
        while True:
            ind = _getbits(newnode.index, level)
            level += 1
            child = node.children[ind]
            if child is None or child.index == newnode.index:
                if child:
                    assert child.value == newnode.value
                node.children[ind] = newnode
                break
            elif child.index == _root_index:
                # This is a branch
                node = child
            else:
                branch = LookupTreeNode()
                nind = _getbits(newnode.index, level)
                cind = _getbits(child.index, level)
                node.children[ind] = branch

                # Life gets tricky when...
                if nind == cind:
                    branch.children[cind] = child
                    # recurse
                    node = branch
                else:
                    branch.children[nind] = newnode
                    branch.children[cind] = child
                    break