Changed the way Affinity Measures are used. Didn't do it properly the first time.
Added the Cosine affinity measure.