added Yajie's DTW code