replaced all Math.random with Random