if (i == (numNewTraces - 1))
if (output.getWidth() % maxWidth != 0 && i == (numNewTraces - 1))
    private void breakUpSplit(Trace trace, LinkedList<Trace> traces) {        OutputTraceNode output = trace.getTail();               //do nothing if we have less than maxwidth connections        if (output.getWidth() <= maxWidth)            return;                int numNewTraces = output.getWidth() / maxWidth +             (output.getWidth() % maxWidth > 0 ? 1 : 0);                CType type = output.getType();                //here are the weights and edges lists we will build for         //each new trace's output trace node        LinkedList<Integer>[] newOutputsWeights =             new LinkedList[numNewTraces];        LinkedList<LinkedList<Edge>>[] newOutputsDests =             new LinkedList[numNewTraces];        //now init them        for (int i = 0; i < numNewTraces; i++) {            newOutputsWeights[i] = new LinkedList<Integer>();            newOutputsDests[i] = new LinkedList<LinkedList<Edge>>();        }                        //these are for the new output trace that will be installed for the        //original trace, we have to use the integer index at this time        //because during construction the edges are not created yet        LinkedList<Integer> origTraceNewWeights = new LinkedList<Integer>();        LinkedList<LinkedList<Integer>> origTraceNewDests =             new LinkedList<LinkedList<Integer>>();        //the new output trace node for the original trace        OutputTraceNode newOutput =  new OutputTraceNode();                //assign the unique edges (dests) of the original outputtrace        //to the new outputtraces        HashMap<Edge, Integer> assignment = new HashMap<Edge, Integer>();        Iterator<Edge> dests = output.getDestSequence().iterator();        for (int i = 0; i < numNewTraces; i++) {            int count = maxWidth;            if (i == (numNewTraces - 1))                count = output.getWidth() % maxWidth;            for (int j = 0; j < count; j++) {                 Edge edge = dests.next();                //System.out.println("Assignment: " + edge + " " + i);                assignment.put(edge, new Integer(i));            }        }                //make sure we have assigned each of the edges        assert !dests.hasNext();                //loop through the ports and construct the weights and edges of hte        //new output traces nodes and the new output trace node of the         //original trace        for (int i = 0; i < output.getDests().length; i++) {            //store the distribution of edges of this port to the new output            //traces here            HashMap<Integer, LinkedList<Edge>> newEdges =                 new HashMap<Integer, LinkedList<Edge>>();            //the port as we construct it for the new output trace node            //of the original trace            LinkedList<Integer> origTracePort = new LinkedList<Integer>();                                    for (int j = 0; j < output.getDests()[i].length; j++) {                Edge edge = output.getDests()[i][j];                Integer index = assignment.get(edge);                if (newEdges.containsKey(index)) {                    //add to the existing linked list                    newEdges.get(index).add(edge);                }                else {                    //create a new linked list                    LinkedList<Edge> newlist = new LinkedList<Edge>();                    newlist.add(edge);                    newEdges.put(index, newlist);                }                //add to the new pattern splitting of the original trace                //but only add a destination if it has not been seen                 //already for this item, it will be duplicated as necessary                //but the new traces' output trace node                if (!origTracePort.contains(index))                    origTracePort.add(index);            }                        Iterator<Integer> indices = newEdges.keySet().iterator();            while (indices.hasNext()) {                int index = indices.next().intValue();                newOutputsWeights[index].add(new Integer(output.getWeights()[i]));                newOutputsDests[index].add(newEdges.get(new Integer(index)));            }            origTraceNewDests.add(origTracePort);            origTraceNewWeights.add(new Integer(output.getWeights()[i]));        }                  Trace[] newTraces = new Trace[numNewTraces];                //now create the new traces using the new outputTracennodes        for (int n = 0; n < numNewTraces; n++) {            newTraces[n] = fixEdgesAndCreateTrace(newOutputsWeights[n],                    newOutputsDests[n], newOutput,  type);            //add the new trace to the trace list            traces.add(newTraces[n]);        }                //fix the outgoing edges of the trace node by creating         //a new output trace node        LinkedList<LinkedList<Edge>> origTraceNewEdges =             new LinkedList<LinkedList<Edge>>();        for (int i = 0; i < origTraceNewDests.size(); i++) {            LinkedList<Edge> port = new LinkedList<Edge>();            for (int j = 0; j < origTraceNewDests.get(i).size(); j++) {                //convert the index into the new trace array                 //into the single incoming edge of the new trace                //so that it connects to the original trace                port.add(newTraces[origTraceNewDests.get(i).get(j).intValue()].                        getHead().getSingleEdge());            }            //add the port the pattern of output of the original trace            origTraceNewEdges.add(port);        }        newOutput.set(origTraceNewWeights, origTraceNewEdges);                //install the new output trace node        newOutput.setPrevious(output.getPrevious());        newOutput.getPrevious().setNext(newOutput);        newOutput.setParent(trace);        trace.setTail(newOutput);                //set the multiplicities of the identity filter of the new trace        setMultiplicitiesSplit(newTraces);    }