added frequency-based update code