Corrected the inputs of bunch generation function