implements similarity for the 3 metrics