Another version with extended logging.