Changed class Random with Math.random()