make num_buckets private and add tests