sort out the layout and footer