     open override var collectionViewContentSize: CGSize {
         guard let collectionView = collectionView else { return super.collectionViewContentSize }
         let cellWidth = configuration.cellSize.width
-        let width = CGFloat(cellCount-1)*cellWidth+collectionView.bounds.width
+        let width = CGFloat(cellCount - 1) * cellWidth+collectionView.bounds.width
         return CGSize(width: width, height: collectionView.bounds.width)
     }
 

    public var configuration: CPStageLayoutConfiguration
    public var currentIndex: Int {
        if let collectionView = collectionView {
            var index = Int(round(collectionView.contentOffset.x/configuration.cellSize.width))
            
            if index>=cellCount && cellCount>0 {
                index = cellCount-1
            }
            
            return index

        self.configuration =  CPStageLayoutConfiguration(withCellSize: CGSize(width: 100, height: 100))
        super.init(coder: aDecoder)
    }
    
    public func contentOffsetFor(indexPath: IndexPath) -> CGPoint {
        var contentOffset = CGPoint(x: CGFloat(), y: CGFloat())
        contentOffset.x = CGFloat(indexPath.item) * configuration.cellSize.width
        contentOffset.y = 0
        return contentOffset
    }

    open override func layoutAttributesForItem(at indexPath: IndexPath) -> UICollectionViewLayoutAttributes? {
        let attributes = super.layoutAttributesForItem(at: indexPath)!
