numerous optimizations & reduced number of function calls
better seeding of RNG