successfully ports count-grams to python
minor tweak