Switch to Mersenne twister for random numbers