The algorithm of affection