rewritten the headers functions to work globally & locally.