Rewrote script to compute setdiff values based on pre-existing values,
and thus got rid of a for loop in the END pattern. Hopefully this will
be simpler and also faster.