writing a bit of the header logic