             top += headerInset.top
             
             if headerHeight > 0 {
-                let attributes = UICollectionViewLayoutAttributes(forSupplementaryViewOfKind: ETCollectionElementKindSectionHeader, with: IndexPath(item: 0, section: section))
+                let attributes = UICollectionViewLayoutAttributes(forSupplementaryViewOfKind: UICollectionElementKindSectionHeader, with: IndexPath(item: 0, section: section))
                 attributes.frame = CGRect(x: headerInset.left,
                                           y: top,
                                           width: (self.collectionView?.bounds.size.width)!,
                                           height: headerHeight)
                 self.headersAttributes[section] = attributes
-                self.allItemAttributes[section] = attributes
+                self.allItemAttributes.append(attributes)
                 
                 top = attributes.frame.maxY + headerInset.bottom
             }

}

class ETCollectionViewWaterfallLayout: UICollectionViewLayout {

    open var columnCount: Int = 2 {
        didSet {
            if columnCount != oldValue {

    case rightToLeft
}

@objc protocol ETCollectionViewDelegateWaterfallLayout: class, UICollectionViewDelegate {
    
    @objc func collectionView(_ collectionView: UICollectionView, layout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize
