Added word frequency filtering