Increase run speed

used set's faster "in" feature, instead of iterating over set (as you
would in a list).