public void compact() throws Exception
    {
        ArrayList<Row> delenda = new ArrayList<Row>();
        for ( int i=0;i<rows.size();i++ )
        {
            for ( int j=0;j<rows.size();j++ )
            {
                if ( i != j )
                {
                    Row r = rows.get( i );
                    Row s = rows.get( j );
                    if ( !delenda.contains(r) && !delenda.contains(s) )
                    {
                        if ( r.merge(s) )
                        {
                            delenda.add( s );
                        }
                    }
                }
            }
        }
        for ( int i=0;i<delenda.size();i++ )
        {
            rows.remove( delenda.get(i) );
        }
    }