implemented bucketing fully