added removeGrid() function