building up headers and such