added more code for the grid class