Added documentation to some dense methods.

  Also, made minor changes to code functionality in various places.