     @IBOutlet var getStartedButtonBottomConstraint: NSLayoutConstraint!
     var getStartedButtonInitialBottomConstraint:CGFloat!
     @IBOutlet var pageControll: UIPageControl!
-    
-    var buttonInitialPostionY:CGFloat = 0
-    var buttonEndPositionY:CGFloat = 0
+
     var logoInitialPositionY:CGFloat = 0
     var welcomeLabelInitialPositionY:CGFloat = 0
     

        case 2.0...3.0:
            thirdAnimationView.progress =  progress - 2
            secondAnimationView.progress = 3 - progress
        case 3.0...4.0:
            thirdAnimationView.progress = 4 - progress
            // get a startpoint where x is zero when on page 4, increasing the content offsett will give value from 0 to the size of one frame.width
            let startPointX = scrollView.contentOffset.x - (scrollView.frame.width * 3)
            // Then we use this translated x offset to increase/decreace the y position of the button
            let translatedXPostitionToY = buttonInitialPostionY - startPointX
            // stop decreasing y when welcome label reaches the middle of the screen
            if startPointX < scrollView.frame.height / 2 {
                getStartedButtonBottomConstraint.constant = translatedXPostitionToY + getStartedButtonInitialBottomConstraint
                getStartedButton.setNeedsLayout()
                //getStartedButton.center.y =  translatedXPostitionToY
                buttonEndPositionY = getStartedButton.center.y
                //loginContainerViewBottomConstraint.constant = translatedXPostitionToY
            }
            pageControll.alpha = (4 - progress)
            logoImageView.hidden = true
            welcomeLabel.hidden = true
        case 4.0...5.0:
            // get a startpoint where x is zero when on page 5
            let startPointX = scrollView.contentOffset.x - (scrollView.frame.width * 4)
            // If the user over scrolls the scrollview in x, move the button equally in y
            getStartedButton.center.y = buttonEndPositionY - startPointX
        default: break
        }
    }
    
    @IBAction func getStartedButtonAction(sender: AnyObject) {
        
        var storyboard:UIStoryboard!
        let userDefaults = NSUserDefaults.standardUserDefaults()
        
        let shouldViewNewFeatures = !userDefaults.boolForKey("hasViewedNewFeaturesForVersion")
        
        if shouldViewNewFeatures{
            storyboard = UIStoryboard(name: "NewFeatures", bundle: nil)
        } else {
            storyboard = UIStoryboard.storyboardForCurrentUserInterfaceIdiom()
        }
        
        // Store that user has viewed the onboarding
        let userdefaults = NSUserDefaults.standardUserDefaults()
        userDefaults.setBool(true, forKey: "hasViewedOnboarding")
        userDefaults.synchronize()
        
        let viewcontroller:UIViewController = storyboard.instantiateInitialViewController() as UIViewController
        self.presentViewController(viewcontroller, animated: false) { () -> Void in
        }
    }

    func panBackground() {

        if !hasSetUpAnimationViews{
            setupAnimationViews()
            hasSetUpAnimationViews = true
            getStartedButtonInitialBottomConstraint = getStartedButtonBottomConstraint.constant
            println(getStartedButtonInitialBottomConstraint)
        }
    }
    
    override func viewDidLayoutSubviews() {
        super.viewDidLayoutSubviews()
        logoInitialPositionY = logoImageView.center.y
        welcomeLabelInitialPositionY = welcomeLabel.center.y
        panBackground()
