finished support for logging.  added comments