Added Frequency, fixing some bugs