incorporated feedback into AD script