implemented DTW, not working correctly, must check it