added affinity generator