Accounted for the case if the similarity =0