use much faster impl of string distance