added reading the frequency, returns buckets