added more functions to manipulate the grid data