average common string distance method