working out the header