Replaced old xor shift random code with Mersenne Twister and updated the way the seed is generated