tfidf and other things self implemented