 				if (testChild && !testChild.visible) realN--;
 			}
 			
-			if (isNaN(useWidth)) useWidth = Math.floor(area.width / numColumns); // + gap
+			if (isNaN(useWidth)) useWidth = Math.floor(host.width / numColumns); // + gap
 			if (isNaN(useHeight)) {
 				// given the width and total number of items, how many rows?
 				var numRows:Number = Math.floor(realN/numColumns);
-				useHeight = Math.floor(area.height / numRows);
-			}
+				useHeight = Math.floor(host.height / numRows);
+			}
+			
+			var maxWidth:Number = useWidth;
+			var maxHeight:Number = useHeight;
 			
 			for(var i:int=0; i < n; i++)
 			{

				child.y = ypos;
				
				xpos += useWidth;
				
				var test:Number = (i+1)%numColumns;
				
				if (test == 0) {
					xpos = 0;
					ypos += useHeight;
				} 
			}
            return true;
		}
	}
}

	import org.apache.flex.core.ILayoutParent;
	import org.apache.flex.core.IStrand;
	import org.apache.flex.core.IUIBase;
	import org.apache.flex.core.IViewport;
	import org.apache.flex.core.IViewportModel;
	import org.apache.flex.core.UIBase;
	import org.apache.flex.events.Event;
	import org.apache.flex.events.IEventDispatcher;
