Still trying to fix the term frequency bug