Adding more doc.  Added optional logging.