         if attributes.representedElementKind != nil { return }
         guard let collectionView = self.collectionView else { return }
     
-        if let itemHeight = delegate!.itemSize {
-            itemSize.height = itemHeight
+        
+        if let itemSize = delegate!.itemSize {
+            if scrollDirection == .Vertical { self.itemSize.height = itemSize } else { self.itemSize.width = itemSize}
         } else {
             let sizeOfItem = sizeForitemAtIndexPath(attributes.indexPath)
             itemSize.height = sizeOfItem.height
+            // jt101 the width is already set form the outside. may change this to all inside here.
         }
         
         var stride: CGFloat = 0

                        
                        if scrollDirection == .Vertical {
                            contentHeight += (attribute.frame.height * CGFloat(numberOfRows))
                        }
                    }
                    cellCache[section]!.append(attribute)
                }
            }
            

        }
        
        if scrollDirection == .Horizontal {
            contentWidth = self.collectionView!.bounds.size.width * CGFloat(numberOfMonthsInCalendar * numberOfSectionsPerMonth)
            contentHeight = self.collectionView!.bounds.size.height
        } else {
            contentWidth = self.collectionView!.bounds.size.width

            let headerOrigin = headerCache[attributes.indexPath.section].frame.origin.y
            stride += headerSize + headerOrigin
        } else { // If there are no headers then alll the cells will have the same height, therefore the strides will have the same height
            
            stride = scrollDirection == .Horizontal ?
                 CGFloat(attributes.indexPath.section) * itemSize.width * CGFloat(numberOfColumns):
                CGFloat(attributes.indexPath.section) * itemSize.height * CGFloat(numberOfRows)
        }
        
        var xCellOffset : CGFloat = CGFloat(attributes.indexPath.item % 7) * self.itemSize.width
