A couple of variations on the LCS (Longest Common Subsequence) algorithm used for improved template matching in noisy time series