added the most of the default header and footer code