writing the header should be encapsulated in some function too