add comments and clean up header