actually generate grid
Generate grid method