Converted the grid to a class