some overdue rearrangement of bucketing code, revealed error noted in spark notes