added mt_rand() for testing