Add another bucketing algorithm

... from @jameh. Thanks!