 				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++)
 			{

		public function layout():Boolean
		{
			// this is where the layout is calculated
			var p:ILayoutParent = _strand.getBeadByType(ILayoutParent) as ILayoutParent;
			var area:UIBase = p.contentView as UIBase;
			
			var xpos:Number = 0;
			var ypos:Number = 0;

			_strand = value;			
		}
		
		private var _viewportModel:IViewportModel;
		
		/**
		 *  The data that describes the viewport used by this layout.
		 *  
		 *  @langversion 3.0
		 *  @playerversion Flash 10.2
		 *  @playerversion AIR 2.6
		 *  @productversion FlexJS 0.0
		 */
		public function get viewportModel():IViewportModel
		{
			return _viewportModel;
		}
		public function set viewportModel(value:IViewportModel):void
		{
			_viewportModel = value;
		}
		
		private var _numColumns:Number = 4;
		private var _columnWidth:Number = Number.NaN;
		private var _rowHeight:Number = Number.NaN;
