     let presentInteraction = SidebarPresentInteraction()
     let dismissInteraction = SidebarDismissInteraction()
     
-    var snapshotViewForDismissedController:UIView = UIView()
-    var peekGapForDismissedController:CGFloat = 40
+    var dismissedControllerView:UIView? = nil
+    var peekViewForDismissedController = UIView()
+    var constraintForPeekView:NSLayoutConstraint!
+    var gapForPeekView:CGFloat = 40
+    
     var presentAnimationDuration:NSTimeInterval = 0.5
     var dismissAnimationDuration:NSTimeInterval = 0.5
     

        let containerView = transitionContext.containerView()!
        let bounds = UIScreen.mainScreen().bounds
        
        self.MainController.view.removeConstraints(self.MainController.snapshotViewForDismissedController.constraints)
        self.MainController.snapshotViewForDismissedController.removeFromSuperview()
        self.MainController.snapshotViewForDismissedController = fromViewController.view.snapshotViewAfterScreenUpdates(true)
        
        fromViewController.view.frame = bounds
        toViewController.view.frame = bounds

        let gesture = UIScreenEdgePanGestureRecognizer(target: self, action: #selector(self.handlePanGesture(_:)))
        gesture.edges = .Right
        view.addGestureRecognizer(gesture)
        
        let touch = UIPanGestureRecognizer(target: self, action: #selector(self.handlePanGesture(_:)))
        viewController.peekViewForDismissedController.addGestureRecognizer(touch)
    }
    
    func handlePanGesture(gestureRecognizer: UIPanGestureRecognizer) {
