Added code for generating header.  Cleaned up formatting code.