Improving the random grid generator.