For some reason, using Math.random() * x will produce a random number at some points of the code, but will simply produce the max number at other points. Could there be something causing this that you don't need to see the code for?