I don't believe setClasses should be additive. This should clobber, therefore no looping would be necessary.