kmajor rework: use levenstein edit diff