optimizing sets