Fixing randomness to have uniform distribution

See last example on this page; https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/random#Example:_Using_Math.random

ak :)