Changed the random number generator to mt_rand()