fastDTW reimplemented, now works segment by segment