Compare matrix bug fixed and added implementation of tf-idf