             parentTable[parentStack[i]] = i + 1;
         }
         // remember the current parent
-        parent = parentStack[parentStack.length - 1];
-        
-        var tmpChildnodes:ICollectionView;
-        var childCursor:IViewCursor;
+        parentOfCurrentNode = parentStack[parentStack.length - 1];
+        
+        var changingNodeAndSiblings:ICollectionView;
+        var changingCollectionCursor:IViewCursor;
 
         if (event.kind == CollectionEventKind.ADD)
         {


            for (i = 0; i < n; i++)
            {
                node = event.items[i];
                if (isBefore)
                {
                    // if the removed node is before the current
                    // and they share parent's then we have to
                    // adjust the currentChildIndex or
                    // the stack of child indexes.
                    nodeParent = collection.getParentItem(node);
                    tmpChildnodes = collection.getChildren(nodeParent);
                    if (nodeParent == parent)
                    {
                        if (tmpChildnodes != null)
                        {
                            childCursor = tmpChildnodes.createCursor();
                            try
                            {
                                childCursor.seek(currentChildBookmark);
                                childCursor.movePrevious();
                                currentChildBookmark = childCursor.bookmark;
                            }
                            catch (e:ItemPendingError)
                            {

            else
            {
                //if no childnodes then we're probably at the top level
                if (parentBookmarkStack.length == 0)
                {
                    //check for more top level siblings
                    //and if we're here the depth should be 1
