added splitting of data into buckets