templated the iterators for the abstract class, so they can be used in the set operations. also organized code a little