                 case .Horizontal:
                     let delta = newBounds.origin.x - collectionView.bounds.origin.x
                     let touchPoint = collectionView.panGestureRecognizer.locationInView(collectionView)
-                    for (index, behavior) in behaviors.enumerate() {
+                    for behavior in behaviors {
                         let yDistanceFromTouch = fabs(touchPoint.y - behavior.anchorPoint.y)
                         let xDistanceFromTouch = fabs(touchPoint.x - behavior.anchorPoint.x)
                         let scrollResistance = (yDistanceFromTouch + xDistanceFromTouch) / 1500

        return super.layoutAttributesForElementsInRect(rect)
    }

    public override func layoutAttributesForItemAtIndexPath(indexPath: NSIndexPath) -> UICollectionViewLayoutAttributes! {
        if let attributes = dynamicAnimator?.layoutAttributesForCellAtIndexPath(indexPath) {
            return attributes
        }

        
        if let contentSize = collectionView?.contentSize, dynamicAnimator = dynamicAnimator, items = super.layoutAttributesForElementsInRect(CGRect(x: 0, y: 0, width: contentSize.width, height: contentSize.height)) {
            if dynamicAnimator.behaviors.count < 1 {
                for item in items {
                    let behaviour = UIAttachmentBehavior(item: item, attachedToAnchor: item.center)
                    behaviour.length = 0
                    behaviour.damping = 0.8
