mostly done freq.py