AD tweaks to original DO script