add destructor for grid class