         
         let expectedIndex = expectedIndex ?? index
         let expectedDiff = CGFloat(max(1, abs(expectedIndex - index)))
-        let expectedPosition = self.calculatePagePosition(for: currentContentOffset,
-                                                 pageSize: pageSize,
-                                                 indexDiff: expectedDiff) ?? CGFloat(index)
-        
-        guard self.isInfinitelyScrolling(forPosition: expectedPosition) == false else {
+        let expectedPosition = calculatePagePosition(for: currentContentOffset,
+                                                     pageSize: pageSize,
+                                                     indexDiff: expectedDiff) ?? CGFloat(index)
+        
+        guard !isInfinitelyScrolling(forPosition: expectedPosition) else {
             return 1
         }
         return expectedDiff

        // provide scroll updates
        var positionPoint: CGPoint!
        let direction = NavigationDirection.forPosition(pagePosition, previous: previousPosition)
        if self.navigationOrientation == .horizontal {
            positionPoint = CGPoint(x: pagePosition, y: scrollView.contentOffset.y)
        } else {
            positionPoint = CGPoint(x: scrollView.contentOffset.x, y: pagePosition)
        }
        
        // ignore duplicate updates
        guard self.currentPosition != positionPoint else {
            return
        }
        self.currentPosition = positionPoint
        self.delegate?.pageboyViewController(self,
                                             didScrollTo: positionPoint,
                                             direction: direction,
                                             animated: self.isScrollingAnimated)
        
        self.previousPagePosition = pagePosition
    }
    
    public func scrollViewWillBeginDragging(_ scrollView: UIScrollView) {

    /// - Parameter scrollView: The scroll view.
    /// - Returns: Whether the contentOffset was manipulated to achieve bouncing preference.
    @discardableResult private func updateContentOffsetForBounceIfNeeded(scrollView: UIScrollView) -> Bool {
        guard bounces == false else {
            return false
        }
        
        let previousContentOffset = scrollView.contentOffset
        if currentIndex == 0 && scrollView.contentOffset.x < scrollView.bounds.size.width {
            scrollView.contentOffset = CGPoint(x: scrollView.bounds.size.width, y: 0.0)
        }
        if currentIndex == (viewControllerCount ?? 1) - 1 && scrollView.contentOffset.x > scrollView.bounds.size.width {
            scrollView.contentOffset = CGPoint(x: scrollView.bounds.size.width, y: 0.0)
        }
        return previousContentOffset != scrollView.contentOffset
