Corrected null pointer exception
Implemented math.random