add a maxcount field instead of dual-purposing frequency.

also fix a small bug with initializing things wrongly.