         
          // Generate and cache the headers
         for section in 0..<maxSections {
-            
             if headerViewXibs.count > 0 {
                 // generate header views
                 let sectionIndexPath = NSIndexPath(forItem: 0, inSection: section)

        // Use the calculaed header size and force thw width of the header to take up 7 columns
        let modifiedSize = CGSize(width: itemSize.width * CGFloat(numberOfColumns), height: headerSize.height)
        
        
        
        attributes.frame = scrollDirection == .Horizontal ?
            CGRect(x: strideOffset, y: 0, width: modifiedSize.width, height: modifiedSize.height) :
            CGRect(x: 0, y: strideOffset, width: modifiedSize.width, height: modifiedSize.height)
        if attributes.frame == CGRectZero { return nil }
        
        return attributes
    }
    
    func applyLayoutAttributes(attributes : UICollectionViewLayoutAttributes) {
        if attributes.representedElementKind != nil { return }
        guard let collectionView = self.collectionView else { return }
    
        // Calculate the item size
        if let itemSize = delegate!.itemSize {

                        attributes.append(val)
                    } else {
                        missCount += 1
                        if missCount > maxMissCount && beganIntercepting { break }// If there are at least 8 misses in a row since intercepting began, then this section has no more interceptions. So break
                    }
                }
                if missCount > maxMissCount && beganIntercepting { break }// Also break from outter loop
            }
        }
        return attributes
