         
         // Calculate times based on marquee type
         let totalDuration: CGFloat
+        let keyTimes: [CGFloat]
+        
         switch (type) {
         case .leftRight, .rightLeft:
             //NSAssert(values.count == 5, @"Incorrect number of values passed for MLLeftRight-type animation")
             totalDuration = 2.0 * (delay + interval)
             // Set up keyTimes
-            animation.keyTimes = [
+            keyTimes = [
                 0.0,                                            // Initial location, home
                 delay/totalDuration,                            // Initial delay, at home
                 (delay + interval)/totalDuration,               // Animation to away

        }
        
        // Set values
        animation.values = values
        
        return animation

            //NSAssert(values.count == 3, @"Incorrect number of values passed for MLContinous-type animation")
            totalDuration = delay + interval
            // Set up keyTimes
            keyTimes = [
                0.0,                        // Initial location, home
                delay/totalDuration,        // Initial delay, at home
                1.0                         // Animation to away
