cleaned up update_freq_range function