fixed bad use of set operations. thansk to C. Junghans