                             self?.contentOffset = pos
                             self?.updateBounds()
                             self?.updateCells()
-                        })
+                    })
                     offsetChangeAnimation?.animate(1.0, duration: CGFloat(animationTime), completion: { [weak self] in
                         if runCompletion {
-                            //                            print("end animation")
                             if let strongSelf = self {
-//                                strongSelf.contentOffset = pagePoint
                                 strongSelf.directionLockedTo = .Both
                                 strongSelf.delegate?.endlessPageViewDidEndDecelerating(strongSelf)
                             }
                         }
-                        })
- 
-//                    offsetChangeAnimation = UIViewPropertyAnimator(duration: animationTime
-//                        , controlPoint1: contentOffset
-//                        , controlPoint2: pagePoint
-//                        , animations: { [weak self] (position) in
-//                            
-//                            self?.contentOffset = pagePoint
-//                            self?.updateBounds()
-//                            self?.updateCells()
-//                    })
-//                    
-                    /*
-                    offsetChangeAnimation = UIViewPropertyAnimator(duration: animationTime
-                        , curve: .easeOut
-                        , animations: { [weak self] in
-                            if let strongSelf = self {
-                                strongSelf.contentOffset = pagePoint
-//                                strongSelf.updateBounds()
-//                                strongSelf.updateCells()
-                            }
                     })
-                    
-                    offsetChangeAnimation?.addCompletion { [weak self] (position) in
-                        if runCompletion {
-                            if let strongSelf = self {
-                                strongSelf.contentOffset = pagePoint
-                                strongSelf.directionLockedTo = .Both
-                                strongSelf.delegate?.endlessPageViewDidEndDecelerating(strongSelf)
-                            }
-                        }
-                    }
-                    offsetChangeAnimation?.startAnimation()
-                    */
                 } else {
                     
                     let velocity = panGesture.velocity(in: holder) * -1

                    
                    return point
                }()
                
                //                print("contentOffset: \(contentOffset)")
            }
            
            if panGesture.state == UIGestureRecognizerState.ended {

                        , apply: { [weak self] (pos) in
                            
                            self?.contentOffset = pos
                    })
                    offsetChangeAnimation?.animate(1.0, duration: CGFloat(animationTime), completion: { [weak self] in
                        
                        if let strongSelf = self {
                            strongSelf.directionLockedTo = .Both
                            strongSelf.delegate?.endlessPageViewDidEndDecelerating(strongSelf)
                        }
                    })
                }
            }
        }
    }
    
    // MARK: Public getters
