finish first draft of tf-idf.py