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

            if configuration.leaveStageAnimationStyle == .zoomin
                || configuration.leaveStageAnimationStyle == .fadeAwayAndZoomin
                || configuration.leaveStageAnimationStyle == .blend {
                cellSize = CGSize(width: (1+itemOffset)*topCellSize.width,
                                  height: (1+itemOffset)*topCellSize.height)
            } else {
                cellSize = topCellSize
            }
        } else if itemOffset<=1 && itemOffset>0 {
            centerX = ((width-cellWidth)/2)*(1-itemOffset)+cellWidth/2+collectionView.contentOffset.x
            centerY = ((cellHeight/2-height)/(2))*(1-itemOffset)+height-cellHeight/2
            cellSize = CGSize(width: (cellWidth-topCellSize.width)*itemOffset+topCellSize.width,
                              height: (cellHeight-topCellSize.height)*itemOffset+topCellSize.height)
        } else if itemOffset>1 {
            centerX = collectionView.contentOffset.x+(itemOffset-0.5)*cellWidth+(itemOffset-1)*configuration.spacing
            centerY = height-cellHeight/2
        } else {
            attributes.isHidden = true
            centerX = -width
            centerY = -height
        }
        
        let rotateFactor = fabs(itemOffset*100).remainder(dividingBy: 100)/100
        
        switch configuration.moveAnimationStyle {
        case .waltz where itemOffset>0:
            attributes.transform3D =  CATransform3DRotate(attributes.transform3D, CGFloat(M_PI*2)*rotateFactor, 0, 1, 0)
        case .somefault where itemOffset>0:
            attributes.transform3D =  CATransform3DRotate(attributes.transform3D, CGFloat(M_PI*2)*rotateFactor, 0, 0, 1)
        default:
            attributes.transform3D = CATransform3DIdentity
        }

        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)!
