             }
             return
         }
+
+        let fixedScrollSize: CGFloat
         var xOffset: CGFloat = 0
         var yOffset: CGFloat = 0
         
-        let fixedScrollSize: CGFloat
-        if scrollDirection == .horizontal {
+        switch scrollDirection {
+        case .horizontal:
             if calendarViewLayout.thereAreHeaders || _cachedConfiguration.generateOutDates == .tillEndOfGrid {
                 fixedScrollSize = calendarViewLayout.sizeOfContentForSection(0)
             } else {
                 fixedScrollSize = frame.width
             }
-
+            
             var section = contentOffset.x / fixedScrollSize
             let roundedSection = round(section)
             if abs(roundedSection - section) < errorDelta { section = roundedSection }
             section = CGFloat(Int(section))
-
+            
             xOffset = (fixedScrollSize * section)
             switch destination {
             case .next:

                }
                return
            } else {
                fixedScrollSize = frame.height
                let section = CGFloat(Int(contentOffset.y / fixedScrollSize))
                yOffset = (fixedScrollSize * section) + fixedScrollSize
            }
            
            if yOffset <= 0 {

            } else if xOffset >= contentSize.width - frame.width {
                xOffset = contentSize.width - frame.width
            }
        case .vertical:
            fallthrough
        default:
            guard let currentSection = currentSection() else { return }
            if (destination == .next && currentSection + 1 >= numberOfSections(in: self)) ||
                destination == .previous && currentSection - 1 < 0 ||
                numberOfSections(in: self) < 0 {
                return
            }
            
            if calendarViewLayout.thereAreHeaders {
                
                switch destination {
                case .next:
                    scrollToHeaderInSection(currentSection + 1, extraAddedOffset: extraAddedOffset, completionHandler: completionHandler)
                case .previous:
                    scrollToHeaderInSection(currentSection - 1, extraAddedOffset: extraAddedOffset, completionHandler: completionHandler)
                case .start:
                    scrollToHeaderInSection(0, extraAddedOffset: extraAddedOffset, completionHandler: completionHandler)
                case .end:
