update to string distance code