Averaging the randomness of javascript (Math.random())