how to generate the bins