Change to Math.floor/Math.random lines

Updated to reflect the new arrays in the code