tweaked affinityMatrix