     private func generateGradientAnimation(_ sequence: [MarqueeStep], totalDuration: CGFloat) -> MLAnimation {
         // Setup
         var totalTime: CGFloat = 0.0
+        var stepTime: CGFloat = 0.0
         var fadeKeyValues = [[CGColor]]()
         var fadeKeyTimes = [NSNumber]()
         var fadeTimingFunctions = [CAMediaTimingFunction]()

            if offset == 0 { continue }
            fadeTimingFunctions.append(timingFunctionForAnimationCurve(step.timingFunction))
        }

        
        // Create new animation
        let animation = CAKeyframeAnimation(keyPath: "colors")

        
        for (offset, step) in fadeSteps {
            // Fade times
            if (step is ScrollStep) {
                totalTime += step.timeStep
                stepTime = totalTime
            } else {
                if step.timeStep >= 0 {
                    // Is a Subsequent
                    stepTime = totalTime + step.timeStep
                } else {
                    // Is a Precedent, grab next step
                    stepTime = totalTime + fadeSteps[offset + 1].element.timeStep + step.timeStep
                }
            }
            fadeKeyTimes.append(NSNumber(value:Float(stepTime/totalDuration)))
            
            // Fade Values
            let values: [CGColor]
