         var itemOffset: CGFloat
         
         if configuration.reversed {
-            itemOffset = topItemIndex-item
+            itemOffset = topItemIndex - item
             attributes.zIndex = indexPath.item
         } else {
-            itemOffset =  item-topItemIndex
+            itemOffset =  item - topItemIndex
             attributes.zIndex = -indexPath.item
         }
         

        
        var transform = CGAffineTransform.identity
        
        if itemOffset<visibleCount+1 && itemOffset >= -1 {
            centerX = width/2+itemOffset*configuration.spacingX
            centerY = height/2+collectionView.contentOffset.y+itemOffset*configuration.spacingY
            
            let scaleFactor = 1-itemOffset/CGFloat(visibleCount)*configuration.scaleFactor
            let scaleTransform = CGAffineTransform(scaleX: scaleFactor, y: scaleFactor)
            transform = scaleTransform
            
            attributes.isHidden = false
            attributes.alpha = itemOffset+1
        } else {
            centerX = -width/2
            centerY = -height/2
            
            attributes.isHidden = true
        }
        
        attributes.center = CGPoint(x: centerX+configuration.offsetX,
                                    y: centerY+configuration.offsetY)
        attributes.transform = transform
        //        print("item:\(item) itemOffset:\(itemOffset)")
        return attributes

            spacingY = spacing
        }
    }
    
    public var reversed: Bool = false
    
}
