Updated dtw to be consistent with dtw in R