diff --git a/TestON/drivers/common/api/controller/onosrestdriver.py b/TestON/drivers/common/api/controller/onosrestdriver.py
index da3c994..49e20a2 100644
--- a/TestON/drivers/common/api/controller/onosrestdriver.py
+++ b/TestON/drivers/common/api/controller/onosrestdriver.py
@@ -1512,7 +1512,8 @@
 
     def createFlowBatch( self,
                       numSw = 1,
-                      batchSizePerSw = 1,
+                      swIndex = 1,
+                      batchSize = 1,
                       batchIndex = 1,
                       deviceIdpreFix = "of:",
                       appId=0,
@@ -1564,92 +1565,100 @@
 
         flowJsonList = []
         flowJsonBatch = {"flows":flowJsonList}
+        dev = swIndex
 
-        for dev in range(1, numSw + 1):
-            for size in range(1, batchSizePerSw +1):
-
-                flowJson = { "priority":100,
+        for fl in range(1, batchSize + 1):
+            flowJson = { "priority":100,
                            "deviceId":"",
                            "isPermanent":"true",
                            "timeout":0,
                            "treatment":{"instructions":[]},
                            "selector": {"criteria":[]}}
 
+            main.log.info("fl: " + str(fl))
+            if dev <= numSw:
+                deviceId = deviceIdpreFix + "{0:0{1}x}".format(dev,16)
+                #print deviceId
+                flowJson['deviceId'] = deviceId
+                dev += 1
+            else:
+                dev = 1
                 deviceId = deviceIdpreFix + "{0:0{1}x}".format(dev,16)
                 #print deviceId
                 flowJson['deviceId'] = deviceId
 
                 # ethSrc starts with "0"; ethDst starts with "1"
                 # 3 Hex digit of device number; 4 digits of batch index number; 4 digits of batch size
-                ethS = "{0:0{1}x}".format(dev,4) + "{0:0{1}x}".format(batchIndex,4) + "{0:0{1}x}".format(size,4)
-                ethSrc = ':'.join(ethS[i:i+2] for i in range(0,len(ethS),2))
-                ethD = "1" + "{0:0{1}x}".format(dev,3) + "{0:0{1}x}".format(batchIndex,4) + "{0:0{1}x}".format(size,4)
-                ethDst = ':'.join(ethD[i:i+2] for i in range(0,len(ethD),2))
+            ethS = "{0:0{1}x}".format(dev,4) + "{0:0{1}x}".format(batchIndex,4) + "{0:0{1}x}".format(fl,4)
+            ethSrc = ':'.join(ethS[i:i+2] for i in range(0,len(ethS),2))
+            ethD = "1" + "{0:0{1}x}".format(dev,3) + "{0:0{1}x}".format(batchIndex,4) + "{0:0{1}x}".format(fl,4)
+            ethDst = ':'.join(ethD[i:i+2] for i in range(0,len(ethD),2))
 
-                if appId:
-                    flowJson[ "appId" ] = appId
+            if appId:
+                flowJson[ "appId" ] = appId
 
-                if egressPort:
-                    flowJson[ 'treatment' ][ 'instructions' ].append( {
+            if egressPort:
+                flowJson[ 'treatment' ][ 'instructions' ].append( {
                                                         "type":"OUTPUT",
                                                         "port":egressPort } )
-                if ingressPort:
-                    flowJson[ 'selector' ][ 'criteria' ].append( {
+            if ingressPort:
+                flowJson[ 'selector' ][ 'criteria' ].append( {
                                                         "type":"IN_PORT",
                                                         "port":ingressPort } )
-                if ethType:
-                    flowJson[ 'selector' ][ 'criteria' ].append( {
+            if ethType:
+                flowJson[ 'selector' ][ 'criteria' ].append( {
                                                         "type":"ETH_TYPE",
                                                         "ethType":ethType } )
-                if ethSrc:
-                    flowJson[ 'selector' ][ 'criteria' ].append( {
+            if ethSrc:
+                flowJson[ 'selector' ][ 'criteria' ].append( {
                                                         "type":"ETH_SRC",
                                                         "mac":ethSrc } )
-                if ethDst:
-                    flowJson[ 'selector' ][ 'criteria' ].append( {
+            if ethDst:
+                flowJson[ 'selector' ][ 'criteria' ].append( {
                                                         "type":"ETH_DST",
                                                         "mac":ethDst } )
-                if vlan:
-                    flowJson[ 'selector' ][ 'criteria' ].append( {
+            if vlan:
+                flowJson[ 'selector' ][ 'criteria' ].append( {
                                                         "type":"VLAN_VID",
                                                         "vlanId":vlan } )
-                if mpls:
-                    flowJson[ 'selector' ][ 'criteria' ].append( {
+            if mpls:
+                flowJson[ 'selector' ][ 'criteria' ].append( {
                                                         "type":"MPLS_LABEL",
                                                         "label":mpls } )
-                if ipSrc:
-                    flowJson[ 'selector' ][ 'criteria' ].append( {
+            if ipSrc:
+                flowJson[ 'selector' ][ 'criteria' ].append( {
                                                         "type":ipSrc[0],
                                                         "ip":ipSrc[1] } )
-                if ipDst:
-                    flowJson[ 'selector' ][ 'criteria' ].append( {
+            if ipDst:
+                flowJson[ 'selector' ][ 'criteria' ].append( {
                                                         "type":ipDst[0],
                                                         "ip":ipDst[1] } )
-                if tcpSrc:
-                    flowJson[ 'selector' ][ 'criteria' ].append( {
+            if tcpSrc:
+                flowJson[ 'selector' ][ 'criteria' ].append( {
                                                         "type":"TCP_SRC",
                                                         "tcpPort": tcpSrc } )
-                if tcpDst:
-                    flowJson[ 'selector' ][ 'criteria' ].append( {
+            if tcpDst:
+                flowJson[ 'selector' ][ 'criteria' ].append( {
                                                         "type":"TCP_DST",
                                                         "tcpPort": tcpDst } )
-                if udpSrc:
-                    flowJson[ 'selector' ][ 'criteria' ].append( {
+            if udpSrc:
+                flowJson[ 'selector' ][ 'criteria' ].append( {
                                                         "type":"UDP_SRC",
                                                         "udpPort": udpSrc } )
-                if udpDst:
-                    flowJson[ 'selector' ][ 'criteria' ].append( {
+            if udpDst:
+                flowJson[ 'selector' ][ 'criteria' ].append( {
                                                         "type":"UDP_DST",
                                                         "udpPort": udpDst } )
-                if ipProto:
-                    flowJson[ 'selector' ][ 'criteria' ].append( {
+            if ipProto:
+                flowJson[ 'selector' ][ 'criteria' ].append( {
                                                         "type":"IP_PROTO",
                                                         "protocol": ipProto } )
-                #pprint(flowJson)
-                flowJsonList.append(flowJson)
+            #pprint(flowJson)
+            flowJsonList.append(flowJson)
 
+        main.log.info("Number of flows in batch: " + str( len(flowJsonList) ) )
         flowJsonBatch['flows'] = flowJsonList
-        #pprint(flowJsonBatch)
+        pprint(flowJsonBatch)
 
         return flowJsonBatch
 
diff --git a/TestON/tests/COMPflow/COMPflow.params b/TestON/tests/COMPflow/COMPflow.params
index ac85ea6..f3a0ef5 100755
--- a/TestON/tests/COMPflow/COMPflow.params
+++ b/TestON/tests/COMPflow/COMPflow.params
@@ -44,15 +44,10 @@
     </CASE10>
 
     <CASE1000>
-        <flowsPerSw>14</flowsPerSw>
-        <batches>500</batches>
+        <batchSize>20</batchSize>
+        <batches>10</batches>
     </CASE1000>
 
-    <TEST>
-        <batchSize>200</batchSize>
-        <numThrd>1</numThrd>
-    </TEST>
-
     <SLEEP>
         <startup>15</startup>
         <startMN>5</startMN>
diff --git a/TestON/tests/COMPflow/COMPflow.py b/TestON/tests/COMPflow/COMPflow.py
index 37b5256..7fae518 100644
--- a/TestON/tests/COMPflow/COMPflow.py
+++ b/TestON/tests/COMPflow/COMPflow.py
@@ -229,20 +229,29 @@
         main.case( "Create a json object for the batched flows" )
 
         main.step( "Parse batch information" )
-        main.flowsPerSw = int(main.params['CASE1000']['flowsPerSw'])
-        main.log.info("Number of flows in a batch is:" + str(main.flowsPerSw * main.numSw))
+        main.batchSize = int(main.params['CASE1000']['batchSize'])
+        main.log.info("Number of flows in a batch is:" + str(main.batchSize))
 
         main.flowJsonBatchList = []
         postTimes = []
+        startSw = 1
 
         main.step("Creating a full list of batches")
         for index in range(1, int(main.params['CASE1000']['batches']) + 1):
-            flowJsonBatch = main.ONOSrest.createFlowBatch( numSw = main.numSw,
-                                                           batchSizePerSw = main.flowsPerSw,
+            if startSw <= main.numSw:
+                main.log.info("Creating batch: " + str(index))
+                flowJsonBatch = main.ONOSrest.createFlowBatch( numSw = main.numSw,
+                                                           swIndex = startSw,
+                                                           batchSize = main.batchSize,
                                                            batchIndex = index,
                                                            ingressPort = 2,
                                                            egressPort = 3)
-            main.flowJsonBatchList.append(flowJsonBatch)
+                main.flowJsonBatchList.append(flowJsonBatch)
+
+                startSw += 1
+            else:
+                startSw = 1
+
 
         main.step("Using REST API /flows/{} to post flow batch")
         tStartPost = time.time()
@@ -263,8 +272,7 @@
         tAllAdded = time.time()
 
         numFlows = int(main.params['CASE1000']['batches']) *\
-                                                    int(main.params['CASE1000']['flowsPerSw']) *\
-                                                    int(main.params['CASE10']['numSw'])
+                                                    int(main.params['CASE1000']['batchSize'])
         main.log.info("Total number of flows: " + str (numFlows) )
         main.log.info("Sum of each POST elapse time: " + str(numpy.sum(postTimes)) )
         main.log.info("Total POST elapse time: " + str(tLastPostEnd-tStartPost))
@@ -300,7 +308,7 @@
         tAllRemoved = time.time()
 
         main.log.info("Total number of flows: " + str (int(main.params['CASE1000']['batches']) *\
-                                                    int(main.params['CASE1000']['flowsPerSw']) *\
+                                                    int(main.params['CASE1000']['batchSize']) *\
                                                     int(main.params['CASE10']['numSw'])) )
         main.log.info("Sum of each DELETE elapse time: " + str(numpy.sum(rmTimes)) )
         main.log.info("Total POST elapse time: " + str(tLastRemoveEnd-tStartRemove))
