Playing around with js random number generator