             
             attributes.isHidden = true
         }
-
+        
         attributes.center = CGPoint(x: centerX+configuration.offsetX,
                                     y: centerY+configuration.offsetY)
         attributes.transform = transform
-//        print("item:\(item) itemOffset:\(itemOffset)")
+        //        print("item:\(item) itemOffset:\(itemOffset)")
         return attributes
     }
- 
-    open override var collectionViewContentSize: CGSize {
-        guard let collectionView = collectionView else { return super.collectionViewContentSize }
-        
-        var contentSize = CGSize(width: CGFloat(), height: CGFloat())
-        let cellHeight = configuration.cellSize.height
-        let height = CGFloat(cellCount-1)*cellHeight+collectionView.bounds.height
-        contentSize.width = collectionView.bounds.width
-        contentSize.height = height
-        
-        return contentSize
-    }
+    
 }
+

    }
    
    open override func layoutAttributesForItem(at indexPath: IndexPath) -> UICollectionViewLayoutAttributes? {
        let attributes = super.layoutAttributesForItem(at: indexPath)!
        guard let collectionView = collectionView else { return  attributes}
        
        let item = CGFloat(indexPath.item)
        let width = collectionView.bounds.size.width
        let height = collectionView.bounds.size.height

        visibleCount = max(1, visibleCount)
        var centerX: CGFloat = 0.0
        var centerY: CGFloat = 0.0
        
        //update attributes
        var topItemIndex = calculateTopItemIndex()
        var itemOffset: CGFloat
        
        if configuration.reversed {
            itemOffset = topItemIndex-item
            attributes.zIndex = indexPath.item
        } else {
            itemOffset =  item-topItemIndex
            attributes.zIndex = -indexPath.item
        }
        
        attributes.size = cellSize
        
        var transform = CGAffineTransform.identity
