adjusting rows and columns of the grid and putting them in container