Update grid.c
Update grid.c