Changed set generation function