         }
         return spaceToDistribute;
     }
-
-
-    /*
-    public function fill(unscaledWidth:Number, unscaledHeight:Number):void
-    {
-        var maxWidth:Number = 0;
-        var maxHeight:Number = 0;
-        var vTarget:VirtualizedContainer = _target as VirtualizedContainer;
-
-        if (!vTarget)
-            return;
-            
-        var index:Number = vTarget.firstVisibleChildIndex;
-        
-        while (maxHeight < unscaledHeight)
-        {
-            var child:DisplayObject = vTarget.getOrCreateChildSkin(index++);
-            
-            if (!child)
-                break;
-                
-            var fdoChild:IFlexDisplayObject = child as IFlexDisplayObject;
-            var uicChild:IUIComponent = child as IUIComponent;
-            if((fdoChild as UIComponent == null) || UIComponent(fdoChild).includeInLayout)
-            {
-                if (child is UIComponent)
-                    UIComponent(child).validateNow();
-                    
-                var childWidth:Number = uicChild ? uicChild.getExplicitOrMeasuredWidth() : fdoChild ? Math.max(fdoChild.measuredWidth, 0) : child.width;
-                var childHeight:Number = uicChild ? uicChild.getExplicitOrMeasuredHeight() : fdoChild ? Math.max(fdoChild.measuredHeight, 0) : child.height;
-                
-                maxWidth = Math.max(maxWidth, childWidth);
-                maxHeight += childHeight + GAP;
-            }
-        }
-    }
-    
-    public function get maxHScrollPosition():Number
-    {
-        return 0;
-    }
-    
-    public function get maxVScrollPosition():Number
-    {
-        var targetVirtualizedContainer:VirtualizedContainer = _target as VirtualizedContainer;
-        
-        if (targetVirtualizedContainer)
-            return targetVirtualizedContainer.children.length - target.numChildren;
-        else
-            return target.numChildren;
-    }
-    
-    public function get horizontalPageSize():Number
-    {
-        return 0;
-    }
-    
-    public function get verticalPageSize():Number
-    {
-        // Should calculate this somehow....
-        return 10;
-    }
-    
-    public function scrollPositionToChildIndex(hScrollPosition:Number, vScrollPosition:Number):Number
-    {
-        // For vertical layout, vertical scroll position == child index
-        return vScrollPosition;
-    }
-    */
 }
 }
 

            var itemMinHeight:Number = hasPercentHeight(layoutItem) ? layoutItem.minSize.y : layoutItem.preferredSize.y;
            minWidth = Math.max(minWidth, itemMinWidth);
            minHeight += itemMinHeight;
        }
        
        if (totalCount > 1)
        { 
            var gapSpace:Number = GAP * (totalCount - 1);
            minHeight += gapSpace;
            preferredHeight += gapSpace;
        }
        
        layoutTarget.measuredWidth = preferredWidth;
        layoutTarget.measuredHeight = preferredHeight;

        layoutTarget.measuredMinWidth = minWidth; 
        layoutTarget.measuredMinHeight = minHeight;
    }
    
    public function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
    {

        var minHeight:Number = 0;
        var preferredWidth:Number = 0;
        var preferredHeight:Number = 0;
        var visibleHeight:Number = 0;
        var visibleRows:uint = 0;
        
        var count:uint = layoutTarget.numLayoutItems;
        var totalCount:uint = count; // How many items will be laid out
