Added ngram comparison code