extended regular_grid() to take extra parameters