             morphY.keyPath = "transform.scale.y"
             morphY.values = [1, 0.7, 1.3*force, 0.7, 1]
             morphY.keyTimes = [0, 0.2, 0.4, 0.6, 0.8, 1]
-            morphY.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionDefault)
+            morphY.timingFunction = getTimingFunction(curve)
             morphY.duration = CFTimeInterval(duration)
             morphY.repeatCount = 1
             morphY.beginTime = CACurrentMediaTime() + CFTimeInterval(delay)

                CATransform3DConcat(perspective,CATransform3DMakeRotation(CGFloat(M_PI), 1, 0, 0)))
            animation.duration = CFTimeInterval(duration)
            animation.beginTime = CACurrentMediaTime() + CFTimeInterval(delay)
            animation.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut)
            layer.addAnimation(animation, forKey: "3d")
        case "morph":
            let morphX = CAKeyframeAnimation()
            morphX.keyPath = "transform.scale.x"
            morphX.values = [1, 1.3*force, 0.7, 1.3*force, 1]
            morphX.keyTimes = [0, 0.2, 0.4, 0.6, 0.8, 1]
            morphX.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionDefault)
            morphX.duration = CFTimeInterval(duration)
            morphX.repeatCount = 1
            morphX.beginTime = CACurrentMediaTime() + CFTimeInterval(delay)

        case "fadeOut":
            isFrom = false
            opacity = 0
        case "fadeOutIn":
            let animation = CABasicAnimation()
            animation.keyPath = "opacity"
            animation.fromValue = 1
            animation.toValue = 0
            animation.timingFunction = getTimingFunction(curve)
            animation.duration = CFTimeInterval(duration)
            animation.beginTime = CACurrentMediaTime() + CFTimeInterval(delay)
            animation.autoreverses = true
            layer.addAnimation(animation, forKey: "fade")
        case "fadeInLeft":
            opacity = 0
            x = 300*force
