         let container = transitionContext.containerView
         let containerBounds = container.bounds
         
-        self.frontContainerView.frame = containerBounds
+        frontContainerView.frame = containerBounds
         
         let maxOffset = containerBounds.size.width * maxBackViewTranslationPercentage
 
-        fromView.frame = self.frontContainerView.bounds
-        self.frontContainerView.addSubview(fromView)
-        self.frontContainerView.transform = CGAffineTransform.identity
+        fromView.frame = frontContainerView.bounds
+        frontContainerView.addSubview(fromView)
+        frontContainerView.transform = CGAffineTransform.identity
         
         toView.frame = containerBounds
         toView.transform = CGAffineTransform(translationX: -maxOffset, y: 0)
         
-        self.backOverlayView.frame = containerBounds
+        backOverlayView.frame = containerBounds
         
         container.addSubview(toView)
-        container.addSubview(self.backOverlayView)
-        container.addSubview(self.frontContainerView)
+        container.addSubview(backOverlayView)
+        container.addSubview(frontContainerView)
     }
     
     func updateViewsWithTranslation(_ translation: CGPoint) {
         
-        guard let transitionContext = self.activeContext,
+        guard let transitionContext = activeContext,
             let toView = transitionContext.view(forKey: UITransitionContextViewKey.to) else {
                 return
         }
         
         let container = transitionContext.containerView
         let maxDistance = container.bounds.size.width
-        let percent = self.percentDismissedForTranslation(translation, container: container)
+        let percent = percentDismissedForTranslation(translation, container: container)
 
         let maxFromViewOffset = maxDistance
 
         let maxToViewOffset = maxDistance * maxBackViewTranslationPercentage
         let resolvedToViewOffset = -maxToViewOffset + (maxToViewOffset * percent)
         
-        self.frontContainerView.transform = CGAffineTransform(translationX: maxFromViewOffset * percent, y: 0)
-        self.frontContainerView.dropShadowView.alpha = (1.0 - percent)
+        frontContainerView.transform = CGAffineTransform(translationX: maxFromViewOffset * percent, y: 0)
+        frontContainerView.dropShadowView.alpha = (1.0 - percent)
         toView.transform = CGAffineTransform(translationX: resolvedToViewOffset, y: 0)
-        self.backOverlayView.alpha = (1.0 - percent)
-        
-        self.activeContext?.updateInteractiveTransition(percent)
+        backOverlayView.alpha = (1.0 - percent)
+        
+        activeContext?.updateInteractiveTransition(percent)
     }
     
     func shouldCancelForGestureEndingWithTranslation(_ translation: CGPoint, velocity: CGPoint) -> Bool {
         
-        guard let transitionContext = self.activeContext else {
+        guard let transitionContext = activeContext else {
             return false
         }
         
         let container = transitionContext.containerView
         
-        let percent = self.percentDismissedForTranslation(translation, container: container)
+        let percent = percentDismissedForTranslation(translation, container: container)
         
         return ((percent < minimumDismissalPercentage && velocity.x < 100.0) || velocity.x < 0)
     }
     
     func cancelWithTranslation(_ translation: CGPoint, velocity: CGPoint, completion: @escaping () -> Void) {
         
-        guard let transitionContext = self.activeContext,
+        guard let transitionContext = activeContext,
             let fromView = transitionContext.view(forKey: UITransitionContextViewKey.from),
             let toView = transitionContext.view(forKey: UITransitionContextViewKey.to) else {
                 return

    
    var translation: CGPoint = CGPoint.zero {
        didSet {
            self.updateViewsWithTranslation(translation)
        }
    }
    

        
        if abs(velocity.x) > minimumThresholdVelocity {
            options = .curveEaseOut
            let naiveDuration = durationForDistance(distance: maxDistance, velocity: abs(velocity.x))
            let isFlickingShutEarly = translation.x < maxDistance * minimumDismissalPercentage
            if (naiveDuration > defaultCancelPopDuration && isFlickingShutEarly) {
                duration = defaultCancelPopDuration
