Drawing first and last line of the grid.