add Atomic to replace synchronized. atomicLong randState.