Renamed function appropriately, added a frequency option