more randomness and small improvements