functions to change frequencies and one is called in main