added selective targetting, and made various cosmetic fixes