Cleaned up printing of header and footer