Expanded documentation

Documentation is lacking; expanded the document somewhat. More is
needed.
Removed excess spaces, and added clarity

Added a comment or two, removed all excess spaces, and renamed a
function to a better name.