Initial implementation of affinity'