Doc strings! Also, some logging.