Added headers to the output document

I modified your original to support delivery of the headers to the output document.  So I decided to share that back.  Hopefully you'll find it useful too.

Thank-you,
Eric Martin
elmartin1989@gmail.com