changing the similarity function. #2