public static Fsm uniNLevenshtein(int distance) {
        Fsm fsm = new Fsm();
        fsm.getShortSymbols().put('_', "01");
        fsm.setDefEdgeLabelRot(true);
        //fsm.setBlocksize(distance*2+1);
        for (int i=0; i <= distance; i++) {
            for (int j = -i; j<=i; j++) {
                Vertex n = fsm.addVertex(new Point(30+i*3*(int)fsm.getDefVertexShape().getWidth(),10+(distance+j)*2*(int)fsm.getDefVertexShape().getHeight()));
                n.setName("I"+(j==0?"":(j>0?"+"+j:j))+"^{"+i+"}");
                n.setFinal(true);
                EdgeFsm e = fsm.addEdge(n, n);
                e.rebuildPath();
                e.getTransitions().add(prepareString(distance).replace(j+distance, j+distance+1, "1").toString());
                e.setText();
                if (i>0) {
                    if (j < i-1) {
                        e =fsm.addEdge(fsm.getVertices().get(fsm.getVertices().size()-2*i), n);
                        e.getTransitions().add(prepareString(distance).replace(distance-(-j)+1, distance-(-j)+2, "0").toString());
                        e.setText();
                    }
                    if (i != Math.abs(j)) {
                        e =fsm.addEdge(fsm.getVertices().get(fsm.getVertices().size()-2*i-1), n);
                        e.getTransitions().add(prepareString(distance).replace(distance-(-j), distance-(-j)+1, "0").toString());
                        e.setText();                        
                    }
                    if (j > -i+1) {
                        e =fsm.addEdge(fsm.getVertices().get(fsm.getVertices().size()-2*i-2), n);
                        //e.getTransitions().add(prepareString(distance).replace(distance-(-j)-1, distance-(-j), "0").replace(distance-(-j), distance-(-j)+1, "1").toString());
                        e.getTransitions().add(""+fsm.getEpsSymbol());
                        e.setText();                         
                    }
                     
                }
            }
            
        }
        fsm.getVertices().get(0).setInitial(true);
        return fsm;
    }