refactored wordFreq.py