Modified david's abbreviated script to allow for extension array to be passed into exclude clause