     
     internal func rotate(statusBarOrientation: UIInterfaceOrientation) {
         
-        let rotation = currentRotation(statusBarOrientation)
-        let rads = CGFloat(radians(rotation))
+        if lastInterfaceOrientation != nil {
+            
+            let lastRotation : Double?
+            
+            switch lastInterfaceOrientation! {
+            case .Portrait:
+                
+                switch statusBarOrientation {
+                case .LandscapeLeft:
+                    lastRotation = 90
+                    break
+                case .LandscapeRight:
+                    lastRotation = -90
+                    break
+                case .PortraitUpsideDown:
+                    lastRotation = 180
+                    break
+                default:
+                    lastRotation = 0
+                    break
+                }
+                break
+                
+            case .LandscapeLeft:
+                switch statusBarOrientation {
+                case .Portrait:
+                    lastRotation = -90
+                    break
+                case .LandscapeRight:
+                    lastRotation = 180
+                    break
+                case .PortraitUpsideDown:
+                    lastRotation = 90
+                    break
+                default:
+                    lastRotation = 0
+                    break
+                }
+                break
+                
+            case .LandscapeRight:
+                switch statusBarOrientation {
+                case .Portrait:
+                    lastRotation = 90
+                    break
+                case .LandscapeLeft:
+                    lastRotation = 180
+                    break
+                case .PortraitUpsideDown:
+                    lastRotation = -90
+                    break
+                default:
+                    lastRotation = 0
+                    break
+                }
+                break
+                
+            default:
+                lastRotation = 0
+                break
+            }
+            
+            let lastTransform = CGAffineTransformMakeRotation(CGFloat(radians(lastRotation!)))
+            self.setTransform(lastTransform)
+            
+        }
+
+        let rads = CGFloat(radians(0))
         let transform = CGAffineTransformMakeRotation(rads)
         animationRunning = true
         
         let time = dispatch_time(dispatch_time_t(DISPATCH_TIME_NOW), 1 * Int64(NSEC_PER_SEC)/10)
         dispatch_after(time, dispatch_get_main_queue()) {
+            
             CATransaction.begin()
             CATransaction.setDisableActions(false)
             CATransaction.commit()
-            UIView.animateWithDuration(0.3, delay: 0.1, options: .CurveLinear, animations: {
-//                self.setTransform(transform)
+            
+            UIView.animateWithDuration(
+                self.animationDuration,
+                delay: 0.1,
+                usingSpringWithDamping: self.animationSpring,
+                initialSpringVelocity: 0,
+                options: self.rotateAnimation,
+                animations: {
+                self.setTransform(transform)
                 }, completion: { _ in
                     self.animationRunning = false
             })
+            
         }
     }
     
     func setTransform(transform: CGAffineTransform) {
-        self.cameraButton.transform = transform
         self.closeButton.transform = transform
         self.swapButton.transform = transform
         self.libraryButton.transform = transform

     */
    override public func viewWillTransitionToSize(size: CGSize, withTransitionCoordinator coordinator: UIViewControllerTransitionCoordinator) {
        super.viewWillTransitionToSize(size, withTransitionCoordinator: coordinator)
        if animationRunning {
            return
        }

        view.autoRemoveConstraint(cameraButtonEdgeConstraint)
        
        let attribute : NSLayoutAttribute
        
        switch statusBarOrientation {
            case .Portrait:
                attribute = .Bottom
