add freq logic