             x.keyPath = "position.x"
             x.values = [0, 30*force, -30*force, 30*force, 0]
             x.keyTimes = [0, 0.2, 0.4, 0.6, 0.8, 1]
-            x.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionLinear)
+            x.timingFunction = getTimingFunction(curve)
             x.duration = CFTimeInterval(duration)
             x.additive = true
             x.repeatCount = 1

            animation.keyPath = "transform.scale"
            animation.values = [0, 0.3*force, -0.3*force, 0.3*force, 0]
            animation.keyTimes = [0, 0.2, 0.4, 0.6, 0.8, 1]
            animation.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionDefault)
            animation.duration = CFTimeInterval(duration)
            animation.additive = true
            animation.repeatCount = 1
            animation.beginTime = CACurrentMediaTime() + CFTimeInterval(delay)
            layer.addAnimation(animation, forKey: "pop")
        case "flipX":
            var perspective = CATransform3DIdentity
            perspective.m34 = -1.0 / layer.frame.size.width/2
            

            morphY.keyPath = "transform.scale.y"
            morphY.values = [1, 0.5, 1, 0.5, 1]
            morphY.keyTimes = [0, 0.2, 0.4, 0.6, 0.8, 1]
            morphY.timingFunction = getTimingFunction(curve)
            morphY.duration = CFTimeInterval(duration)
            morphY.repeatCount = 1
            morphY.beginTime = CACurrentMediaTime() + CFTimeInterval(delay)
