                 let interval = calendarLayout.sizeOfContentForSection(targetSection)
                 let diffResistance = diff * resistance
                 
-                if isScrollingForward() {
-                    let recalcOffsetAfterResistanceApplied = theTargetContentOffset - diffResistance
-                    calculatedOffSet = ceil(recalcOffsetAfterResistanceApplied / interval) * interval
-                } else if isScrollingBackward() {
-                    let recalcOffsetAfterResistanceApplied = theTargetContentOffset + diffResistance
-                    calculatedOffSet = floor(recalcOffsetAfterResistanceApplied / interval) * interval
-                }
-                
-                if direction == .Vertical {
-                    let diffResistance = diff * resistance
-                    if isScrollingBackward() {
+                if direction == .Horizontal {
+                    if isScrollingForward() {
+                        let recalcOffsetAfterResistanceApplied = theTargetContentOffset - diffResistance
+                        calculatedOffSet = ceil(recalcOffsetAfterResistanceApplied / interval) * interval
+                    } else {
+                        let recalcOffsetAfterResistanceApplied = theTargetContentOffset + diffResistance
+                        calculatedOffSet = floor(recalcOffsetAfterResistanceApplied / interval) * interval
+                    }
+                } else {
+                    if isScrollingForward() {
+                        calculatedOffSet = theTargetContentOffset - diffResistance
+                    } else {
                         calculatedOffSet = theTargetContentOffset + diffResistance
-                    } else {
-                        calculatedOffSet = theTargetContentOffset - diffResistance
                     }
                     var stopSection = isScrollingForward() ? calendarLayout.sectionFromOffset(calculatedOffSet) : calendarLayout.sectionFromOffset(calculatedOffSet) - 1
                     calculatedOffSet = stopSection < 0 ? 0 : calendarLayout.sectionSize[stopSection]

                
                setTargetContentOffset(calculatedOffSet)
            case let .NonStopToCell(resistance):
                var interval: CGFloat = 0
                var finalValue: CGFloat
                if direction == .Horizontal {
                    interval = calendarLayout.cellCache[targetSection]![0].frame.width
                    let diff = abs(theTargetContentOffset - contentOffset)
                    let diffResistance = diff * resistance
                    
                    let recalcOffsetAfterResistanceApplied: CGFloat
                    
                    if isScrollingForward() {
                        recalcOffsetAfterResistanceApplied = theTargetContentOffset - diffResistance
                        finalValue = ceil(recalcOffsetAfterResistanceApplied / interval) * interval
                    } else {
                        recalcOffsetAfterResistanceApplied = theTargetContentOffset + diffResistance
                        finalValue = floor(recalcOffsetAfterResistanceApplied / interval) * interval
                    }
                    setTargetContentOffset(finalValue)
                } else {
                    let section = calendarLayout.sectionFromOffset(targetContentOffset.memory.y)
                    interval = calendarLayout.cellCache[section]![0].frame.height
                    let diff = abs(theTargetContentOffset - contentOffset)
                    let diffResistance = diff * resistance
                    let recalcOffsetAfterResistanceApplied: CGFloat
                    
                    var finalValue: CGFloat
                    if isScrollingBackward() {
                        recalcOffsetAfterResistanceApplied = theTargetContentOffset + diffResistance
                        finalValue = floor(recalcOffsetAfterResistanceApplied / interval) * interval
                        
                    } else {
                        recalcOffsetAfterResistanceApplied = theTargetContentOffset - diffResistance
                        finalValue = ceil(recalcOffsetAfterResistanceApplied / interval) * interval
                    }
                    
                    if self.registeredHeaderViews.count > 0 { // If we have a vertical direction, we need to account for landing on a header
                        let stopSection = calendarLayout.sectionFromOffset(finalValue)
                        let heightOfHeader = self.calendarView.layoutAttributesForSupplementaryElementOfKind(UICollectionElementKindSectionHeader, atIndexPath: NSIndexPath(forItem: 0, inSection: stopSection))!.frame.height
                        let heightOfCell = calendarLayout.cellCache[stopSection]![0].frame.height
                        let startOfOffset = stopSection == 0 ? 0 : calendarLayout.sectionSize[stopSection - 1]
                        
                        if finalValue > startOfOffset && finalValue < startOfOffset + heightOfHeader { // If the stop value is on a header
                            if finalValue > (0.50 * heightOfHeader) + startOfOffset {
                                // change the final value to the end of the header
                                finalValue = startOfOffset + heightOfHeader
                            } else {
                                // change the final value to the beginning of the header
                                finalValue = startOfOffset
                            }
                        } else { // If the stop value is on a cell
                            // Check to see if we are to stop at a cell or at a header. If we are then adjust the finalValue
                            if let path = self.calendarView.indexPathForItemAtPoint(CGPoint(x: targetContentOffset.memory.x, y: finalValue)) {
                                let attrib = self.calendarView.layoutAttributesForItemAtIndexPath(path)!
                                finalValue = attrib.frame.origin.y + heightOfCell
                                
                            }
                            if finalValue + scrollView.frame.size.height + heightOfCell >= scrollView.contentSize.height {
                                finalValue -= finalValue + scrollView.frame.size.height - scrollView.contentSize.height
                            }
                        }
                        setTargetContentOffset(finalValue)
                    }
                }
                
            case let .NonStopTo(interval, resistance): // Both horizontal and vertical are fixed
                let diffResistance = diff * resistance
                var finalValue: CGFloat = 0

                    let recalcOffsetAfterResistanceApplied = theTargetContentOffset - diffResistance
                    calculatedOffSet = ceil(recalcOffsetAfterResistanceApplied / interval) * interval
                    finalValue = ceil(calculatedOffSet / interval) * interval
                } else {
                    let recalcOffsetAfterResistanceApplied = theTargetContentOffset + diffResistance
                    calculatedOffSet = floor(recalcOffsetAfterResistanceApplied / interval) * interval
                    finalValue = floor(calculatedOffSet / interval) * interval
