better optimizations, random module