add LevDist in mode selection (with tolerance)