Add comments and fix logger.