More portable way to use the mersenne-twister algorithm