added cosine distance to DTW