bug fix with mersenne twister