Tweaked ngram method.