Working on dtw distance