Added a description to each section.

Also refactored some of the code and removed some duplication.