Added Math.random method to the code.