Fix the grids, add headers and footers to the pre