adding header and footer properly and separating them with horizontal lines