added maxCount opt in sortVocab()