replaced C rand() RNG with Mersenne Twister RNG