added DTW recognition (still to be debugged)