fix tfidf to use new counting functions