COmpleted basic tfidf calculator