         var section = 0
         
         var currentMax = 0
-        for sectionIndex in 0..<self.dataDelegate!.numberOfSections() {
-            let cellsInSection = self.dataDelegate!.numberOfCellsInSection(sectionIndex)
+        for sectionIndex in 0..<dataDelegate!.numberOfSections() {
+            let cellsInSection = dataDelegate!.numberOfCellsInSection(sectionIndex)
             currentMax += cellsInSection
             if currentMax > index {
                 row = index - (currentMax - cellsInSection)

    func contentSizeForMode(_ mode: T2GLayoutMode) -> CGSize {
        var height: CGFloat = 0.0
        
        if let dimensions = self.dataDelegate?.dimensionsForCell(mode) {
            let viewX = mode == .collection ? dimensions.padding : (self.frame.size.width - dimensions.width) / 2
            let divisor = self.itemCountPerLine(mode)
            
            var lineCount = 0
            for section in 0..<self.dataDelegate!.numberOfSections() {
                lineCount += (Int(ceil(Double((self.dataDelegate!.numberOfCellsInSection(section) - 1) / divisor))) + 1)
            }
            lineCount -= 1
            
            let ypsilon = viewX + (CGFloat(lineCount) * (dimensions.height + dimensions.padding))
            height = ypsilon + dimensions.height + dimensions.padding + (CGFloat(dataDelegate!.numberOfSections()) * dataDelegate!.dimensionsForSectionHeader().height)
            height = height < self.bounds.height ? (self.bounds.height - 31.0) : height
        }
        return CGSize(width: self.frame.size.width, height: height + 90)
    }
    
    /**

    open func alignVisibleCells() {
        for view in subviews {
            if let cell = view as? T2GCell {
                let frame = frameForCell(indexPath: indexPathForCell(cell.tag))
                if cell.frame.origin.x != frame.origin.x || cell.frame.origin.y != frame.origin.y || cell.frame.size.width != frame.size.width || cell.frame.size.height != frame.size.height {
                    cell.changeFrameParadigm(layoutMode, frame: frame)
                }
            } else {
                if let delimiter = view as? T2GDelimiterView {
                    let frame = frameForDelimiter(section: delimiter.tag - 1)
                    delimiter.frame = frame
                }
            }
