added test for grouping
fixed accidental multiple creation of buckets