added header and footer functions