Changed prints to logging.