     private var diffVectors = [CGFloat]()
     private let function: InterpolationFunction
     private var internalProgress: CGFloat = 0.0
+    private var targetProgress: CGFloat = 0.0
     private var apply: (Interpolatable -> ())
     private var displayLink: CADisplayLink?
     

     Next function used by animation(). Increments progress based on the duration.
     */
    @objc private func next() {
        progress += 1/(self.duration*60)
        if progress >= 1.0 {
            progress = 1.0
            stop()
        }
    }

    //MARK: Animation
    
    /**
     Animates to a targetProgress with a given duration.
     
     - parameter duration:       Duration in seconds. CGFloat.
     - parameter targetProgress: Target progress value. Optional. If left empty assumes 1.0.
     */
    public func animate(duration: CGFloat, targetProgress: CGFloat = 1.0) {
        self.targetProgress = targetProgress
        self.duration = duration
        displayLink?.invalidate()
        displayLink = CADisplayLink(target: self, selector: #selector(next))
