malloc of the grid
work