grid_generator improved