Added more comments.  Removed some duplication.