             var adjustedMaximum: Double = 0.0
             if minimum == 0 { adjustedMinimum = 0.00000000001 }
             if maximum == 0 { adjustedMaximum = 0.00000000001 }
-            return log(input / adjustedMinimum) / log(adjustedMaximum / adjustedMinimum);//not working right for 0 values
+            return log(input / adjustedMinimum) / log(adjustedMaximum / adjustedMinimum)//not working right for 0 values
         }
     }
     

                                    duration: Double = 1.0,
                                    type: CurveType = .Exponential,
                                    curvature: Double = 1.0,
                                    controlRate: Double = 1/60) -> [Double] {
        var curvePoints = [Double]()
        let stepCount = Int(floor(duration / controlRate))
        var counter = 0
        let direction: Double = source > target ? 1.0 : -1.0
        if counter <= stepCount {
            let controlAmount: Double = Double(counter) / Double(stepCount) //normalised 0-1 value
            var scaledControlAmount: Double = 0.0
            
            switch type {
            case .Linear:
                scaledControlAmount = denormalize(controlAmount, minimum: source, maximum: target, taper: 1)
            case .Exponential:
                scaledControlAmount = denormalize(controlAmount, minimum: source, maximum: target, taper: curvature)
            case .EqualPower:
                scaledControlAmount = pow((0.5 + 0.5 * direction * cos(M_PI * controlAmount)), 0.5) //direction will be negative if going up
            }
            curvePoints.append(scaledControlAmount)
            counter += 1

    var fadeTimer = NSTimer()
    var fadeScheduleTimer = NSTimer()
    
    let cadTimerRate: Double = 1 / 60
    var cadDelayTimer: CADisplayLink?
    var cadUpdateTimer: CADisplayLink?
    var cadTimerIncrement: Int = 0
