primary_header changed to dictionary in function definition