      */
     private function calculateElementCount():int
     {
-        // TODO EGeorgie: make sure we cache the values so that we don't calculate twice
-        // on measure and updateDisplayList.
-        // TODO EGeorgie: subtract number of "includeInLayout==false" elements.
-        return target.numLayoutElements;
+        if (-1 != _numLayoutElementsCached)
+            return _numLayoutElementsCached;
+
+        var layoutTarget:GroupBase = target;
+        var count:int = layoutTarget.numLayoutElements;
+        _numLayoutElementsCached = count;
+        for (var i:int = 0; i < count; i++)
+        {
+            var el:ILayoutElement = layoutTarget.getLayoutElementAt(i);
+            if (!el || !el.includeInLayout)
+                _numLayoutElementsCached--;
+        }
+
+        return _numLayoutElementsCached;
     }
 
     /**

        bounds.left = leftEdge(column);
        bounds.right = rightEdge(column);
        return bounds;
    } 

    /**
     *  @private 
     */    
    override protected function elementBoundsRightOfScrollRect(scrollRect:Rectangle):Rectangle
    {
        var bounds:Rectangle = new Rectangle();

    //  justifyRows
    //----------------------------------

    // TODO EGeorgie: add enum class
    private var _justifyRows:String = "none";

    [Inspectable(category="General")]
