DTW_AF modified