Modified reducer for frequency counting