before refactoring mersenne twister stuff