         guard let view = collectionView else { return false }
         
         animator.behaviors.forEach {
-            guard let behavior = $0 as? UIAttachmentBehavior,
-                let item = behavior.items.first else { return }
+            guard let behavior = $0 as? UIAttachmentBehavior, let item = behavior.items.first else { return }
             update(behavior: behavior, and: item, in: view, for: newBounds)
             animator.updateItem(usingCurrentState: item)
         }

    
    public override func prepare() {
        super.prepare()
        guard let view = collectionView,
            let attributes = super.layoutAttributesForElements(in: view.bounds)?
                .flatMap({ $0.copy() as? UICollectionViewLayoutAttributes }) else { return }
        
        oldBehaviors(for: attributes).forEach(animator.removeBehavior(_:))
        newBehaviors(for: attributes).forEach {

    
    private func oldBehaviors(for attributes: [UICollectionViewLayoutAttributes]) -> [UIAttachmentBehavior] {
        let indexPaths = attributes.map { $0.indexPath }
        return animator.behaviors.flatMap {
            guard let behavior = $0 as? UIAttachmentBehavior, let itemAttributes = behavior.items.first as? UICollectionViewLayoutAttributes else { return nil }
            return indexPaths.contains(itemAttributes.indexPath) ? nil : behavior
        }
    }
    
    private func newBehaviors(for attributes: [UICollectionViewLayoutAttributes]) -> [UIAttachmentBehavior] {
        let indexPaths = animator.behaviors.flatMap { (($0 as? UIAttachmentBehavior)?.items.first as? UICollectionViewLayoutAttributes)?.indexPath }
        return attributes.flatMap { return indexPaths.contains($0.indexPath) ? nil : UIAttachmentBehavior(item: $0, attachedToAnchor: $0.center) }
    }
    
    public override func layoutAttributesForElements(in rect: CGRect) -> [UICollectionViewLayoutAttributes]? {
