added function to generate regular grids