added logging to TG40 and removed print statements in TG30.