             itemRemoved(items[i].oldValue, location + i);               
         }
         
-        for (var k:int = length-1; k >= 0; k--)
-        {
-            itemAdded(items[k].newValue, location);
+        for (i = length-1; i >= 0; i--)
+        {
+            itemAdded(items[i].newValue, location);
         }
     }
     

    { 
        var host:DisplayObject;
        
        if (item is GraphicElement)
            host = DisplayObject(GraphicElement(item).elementHost); 
        else if (item is DisplayObject)
            host = DisplayObject(item).parent;
        

        // release the display objects
        if (item && (item is GraphicElement))
        {
            item.parent = null;
            item.sharedDisplayObject = null;
        }
        
