Reformatted the grid class