Add logging.
Reformat and correct documentation.
Formatting changes.