adding a gui to the grid function