diff --git a/views/ngXosViews/mcordTopology/src/js/main.js b/views/ngXosViews/mcordTopology/src/js/main.js
index 4b66991..a3a534c 100644
--- a/views/ngXosViews/mcordTopology/src/js/main.js
+++ b/views/ngXosViews/mcordTopology/src/js/main.js
@@ -42,6 +42,7 @@
       let links = [];
       let traffic = 0;
       let linkWidth = 1;
+      let trafficCorrection = 5;
 
       const filterBBU = (instances) => {
         return lodash.filter(instances, i => i.name.indexOf('BBU') >= 0);
@@ -62,16 +63,36 @@
         links = TopologyElements.links;
 
         Traffic.get()
-        .then((_traffic) => {
-          let delta = (_traffic - traffic);
-          traffic = _traffic
-          linkWidth = _traffic / (delta || traffic);
+        .then((newTraffic) => {
 
-          if(linkWidth < 1){
-            linkWidth = 1;
+          // calculating link size
+          // it should change between 1 and 10
+          if(!traffic){
+            linkWidth = 2;
+          }
+          else if(newTraffic === traffic){
+            linkWidth = linkWidth;
+          }
+          else{
+            let delta = newTraffic - traffic;
+
+            if(delta > 0){
+              linkWidth = linkWidth + (delta / trafficCorrection);
+            }
+            else{
+              linkWidth = linkWidth - ((delta * -1) / trafficCorrection);
+            }
+
+            console.log(`previous traffic: ${traffic}`, `current traffic: ${newTraffic}`, `linkWidth: ${linkWidth}`);
+            console.log('************************');
           }
 
-          console.log(`traffic: ${_traffic}`, `linkWidth: ${linkWidth}`);
+          if(linkWidth < 0.2){
+            linkWidth = 0.2
+          };
+
+          traffic = newTraffic;
+
           return XosApi.Instance_List_GET()
         })
         .then((instances) => {
diff --git a/xos/core/xoslib/static/js/xosMcordTopology.js b/xos/core/xoslib/static/js/xosMcordTopology.js
index d6b2afc..ee82e51 100644
--- a/xos/core/xoslib/static/js/xosMcordTopology.js
+++ b/xos/core/xoslib/static/js/xosMcordTopology.js
@@ -31,6 +31,7 @@
       var links = [];
       var traffic = 0;
       var linkWidth = 1;
+      var trafficCorrection = 5;
 
       var filterBBU = function filterBBU(instances) {
         return lodash.filter(instances, function (i) {
@@ -50,16 +51,33 @@
         nodes = TopologyElements.nodes;
         links = TopologyElements.links;
 
-        Traffic.get().then(function (_traffic) {
-          var delta = _traffic - traffic;
-          traffic = _traffic;
-          linkWidth = _traffic / (delta || traffic);
+        Traffic.get().then(function (newTraffic) {
 
-          if (linkWidth < 1) {
-            linkWidth = 1;
+          // calculating link size
+          // it should change between 1 and 10
+          if (!traffic) {
+            linkWidth = 2;
+          } else if (newTraffic === traffic) {
+            linkWidth = linkWidth;
+          } else {
+            var delta = newTraffic - traffic;
+
+            if (delta > 0) {
+              linkWidth = linkWidth + delta / trafficCorrection;
+            } else {
+              linkWidth = linkWidth - delta * -1 / trafficCorrection;
+            }
+
+            console.log('previous traffic: ' + traffic, 'current traffic: ' + newTraffic, 'linkWidth: ' + linkWidth);
+            console.log('************************');
           }
 
-          console.log('traffic: ' + _traffic, 'linkWidth: ' + linkWidth);
+          if (linkWidth < 0.2) {
+            linkWidth = 0.2;
+          };
+
+          traffic = newTraffic;
+
           return XosApi.Instance_List_GET();
         }).then(function (instances) {
           addBbuNodes(filterBBU(instances));
