     }
     
     public func openSlideMenu() {
-        self.moveSlideMenu(0, animated: true)
+        
+        UIView.animateWithDuration(self.slideDuration, animations: { () -> Void in
+            self.slideMenuViewController.view.frame.origin = CGPoint(x: 0, y: 0)
+            self.activeChild?.view.layer.transform = CATransform3DMakeScale(self.zoomFactor,self.zoomFactor,self.zoomFactor)
+        })
+        
+        // Get our transparentLayer.
+        let transparentLayer = self.activeChild?.view.layer.sublayers!.filter({$0.name == self.transparentLayerKey})[0]
+        
+        // Create the opacity animation function
+        let basicAnimation = CABasicAnimation(keyPath: "opacity")
+        basicAnimation.duration = 0.35
+        basicAnimation.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionLinear)
+        basicAnimation.fromValue = transparentLayer!.opacity
+        
+        // animate to 0 if closed; animate to 0.5 if opening
+        basicAnimation.toValue = 0.5
+        transparentLayer!.opacity = 0.5
+        
+        // exec the animation function
+        transparentLayer!.addAnimation(basicAnimation, forKey: self.transparentLayerAnimationKey)
+        
+        self.slideState = .Opened
+        (self.slideMenuViewController as! FWSlideMenuViewController).progressFinished(.Opened)
     }
     
     public func closeSlideMenu() {
-        self.moveSlideMenu(-self.slideMenuViewController.view.frame.width, animated: true)
+    
+        UIView.animateWithDuration(self.slideDuration, animations: { () -> Void in
+            self.slideMenuViewController.view.frame.origin = CGPoint(x: -self.slideMenuViewController.view.frame.width, y: 0)
+            self.activeChild?.view.layer.transform = CATransform3DIdentity
+        })
+        
+        // Get our transparentLayer.
+        let transparentLayer = self.activeChild?.view.layer.sublayers!.filter({$0.name == self.transparentLayerKey})[0]
+        
+        // Create the opacity animation function
+        let basicAnimation = CABasicAnimation(keyPath: "opacity")
+        basicAnimation.duration = 0.35
+        basicAnimation.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionLinear)
+        basicAnimation.fromValue = 0.5
+        
+        // animate to 0 if closed; animate to 0.5 if opening
+        basicAnimation.toValue = 0
+        transparentLayer!.opacity = 0
+        
+        // exec the animation function
+        transparentLayer!.addAnimation(basicAnimation, forKey: self.transparentLayerAnimationKey)
+ 
+        self.slideState = .Closed
+        (self.slideMenuViewController as! FWSlideMenuViewController).progressFinished(.Closed)
     }
     
     public func displayViewController(vc: UIViewController) {

        basicAnimation.fromValue = transparentLayer!.opacity
        
        // animate to 0 if closed; animate to 0.5 if opening
        if self.slideState == .Opened {
            basicAnimation.toValue = 0.5
            transparentLayer!.opacity = 0.5
        } else if self.slideState == .Closed {
            basicAnimation.toValue = 0
            transparentLayer!.opacity = 0
        } else { // for dragging animation I'll set the duration to 0, because setting opacity directly (w/o animation) is too slow. very crazy
            basicAnimation.duration = 0
            basicAnimation.toValue = Float(0.5-(progress-0.9)*(0.5)/(0.1))
            transparentLayer!.opacity = Float(0.5-(progress-0.9)*(0.5)/(0.1))
        }
        
        // exec the animation function
        transparentLayer!.addAnimation(basicAnimation, forKey: self.transparentLayerAnimationKey)
        
        // Animate all the 3D stuff of the currently active VC
        if state == .Opened || state == .Closed { // Animate the stuff directly
            
            UIView.animateWithDuration(0.4, animations: { () -> Void in
                if self.slideState == .Opened {
                    self.activeChild?.view.layer.transform = CATransform3DMakeScale(self.zoomFactor,self.zoomFactor,self.zoomFactor)
                } else if self.slideState == .Closed {
                    self.activeChild?.view.layer.transform = CATransform3DIdentity
                }
            })
            
        } else { // "smooth" animate
            
            var transform: CATransform3D = CATransform3DIdentity;
            transform.m34 = 1.0 / 400.0; // This is something like the CSS command "perspective:"
            transform = CATransform3DRotate(transform, 1-progress, 0, 1, 0)
            transform = CATransform3DScale(transform, progress, progress, progress)
            self.activeChild?.view.layer.transform = transform;
            
        }
    }
    

        switch recognizer.state {
        case .Changed, .Began, .Possible: // The animation is going on or just started
            let touchPoint = recognizer.locationInView(self.view).x
            self.moveSlideMenu(touchPoint-self.slideMenuViewController.view.frame.width)
            
        case .Ended, .Cancelled, .Failed: // Put the animation to a defined state
            switch self.slideState {
            case .Closing: // If the last known state was closing then close the menu
                self.closeSlideMenu()
            case .Opening: // If the last known state was opening then open the menu
                self.openSlideMenu()
            default:
                break
            }
