random generation in place