similarities function 2nd draft