Change DTW to be iterative.