the enhancement of similarity calculation