initial similarty function