Updated to use Xorshift PRNG