         case (.Ended):
             self.isInteractive = false
             let velocityRequiredToPresent = -CGRectGetWidth(gesture.view!.bounds) * UIApplication.sharedApplication().wmf_tocRTLMultiplier
-            let velocityRequiredToDismiss = CGRectGetWidth(gesture.view!.bounds)
+            let velocityRequiredToDismiss = -velocityRequiredToPresent
             
             let velocityX = gesture.velocityInView(gesture.view).x
-            if velocityX * UIApplication.sharedApplication().wmf_tocRTLMultiplier > velocityRequiredToDismiss{
-                self.cancelInteractiveTransition()
-                return
-            }
-            
-            if velocityX > velocityRequiredToPresent{
-                self.finishInteractiveTransition()
+            if velocityX*velocityRequiredToDismiss > 1 && abs(velocityX) > abs(velocityRequiredToDismiss){
+                cancelInteractiveTransition()
+                return
+            }
+            
+            if velocityX*velocityRequiredToPresent > 1 && abs(velocityX) > abs(velocityRequiredToPresent){
+                finishInteractiveTransition()
                 return
             }
             
             let progressRequiredToPresent = 0.33
             
             if(self.percentComplete >= CGFloat(progressRequiredToPresent)){
-                self.finishInteractiveTransition()
-                return
-            }
-            
-            self.cancelInteractiveTransition()
+                finishInteractiveTransition()
+                return
+            }
+            
+            cancelInteractiveTransition()
             
         case (.Cancelled):
             self.isInteractive = false
-            self.cancelInteractiveTransition()
+            cancelInteractiveTransition()
             
         default :
             break

            presentedControllerView.frame = f

            }, completion: {(completed: Bool) -> Void in
                transitionContext.completeTransition(!transitionContext.transitionWasCancelled())
        })
    }
    

            f.origin.x -= f.size.width * UIApplication.sharedApplication().wmf_tocRTLMultiplier
            presentedControllerView.frame = f
            }, completion: {(completed: Bool) -> Void in
                let cancelled = transitionContext.transitionWasCancelled()
                transitionContext.completeTransition(!cancelled)
        })
    }
    
