Add header generation code to script