Swapped rand() for mt_rand()