Thanks for this PR! However, it brings significant changes to the exiting behaviour/design of the weight distribution, which was done in purpose to be randomised along the 100 calls.
I think your PR should be changed to add a new dispatching, algorithm, leaving the existing one as it is.
A few more comments for coding style, to keep it as much as possible coherent: declare variables at the beginning of function or block; one line comments should be in a single line `/* ... */`, not three lines.