                                          delegate: nil)
         
         
-        gradientShadLayer.animateKeyPath("colors",
+        gradientLayer.animateKeyPath("colors",
                                          fromValue:nil,
                                          toValue: colorsAndLocations.0 as AnyObject?,
                                          beginTime: mediaTime,
                                          duration: kDefaultAnimationDuration,
                                          delegate: nil)
         
-        gradientShadLayer.animateKeyPath("locations",
+        gradientLayer.animateKeyPath("locations",
                                          fromValue:nil,
                                          toValue: colorsAndLocations.1 as AnyObject?,
                                          beginTime: mediaTime,

    func updateGradientLayer()  {
        
        let axial = !typeGardientSwitch.isOn
        

        
        gradientShadLayer.gradientType       = axial ? .axial : .radial
        gradientShadLayer.extendsBeforeStart = extendsPastStart.isOn
        gradientShadLayer.extendsPastEnd     = extendsPastEnd.isOn
        gradientShadLayer.function           = typeFunctionSwitch.isOn ? .exponential : .linear;
        gradientShadLayer.slopeFunction      = self.slopeFunction[(self.tableView.indexPathForSelectedRow! as NSIndexPath).row] ;
        
        let endRadius:CGFloat   = CGFloat(endRadiusSlider.value)
        let startRadius:CGFloat = CGFloat(startRadiusSlider.value)

                                         delegate: nil)
        
        
        gradientLayer.animateKeyPath("startPoint",
                                         fromValue: nil,
                                         toValue: NSValue(cgPoint:rndStartPoint),
                                         beginTime: mediaTime ,
                                         duration: kDefaultAnimationDuration,
                                         delegate: nil)
        
        gradientLayer.animateKeyPath("endPoint",
                                         fromValue: nil,
                                         toValue: NSValue(cgPoint:rndEndPoint),
                                         beginTime: mediaTime,
