fixed previous error, now correct ngram calculation