Made bagOfWords very fast