Adding functional TypingDistance