diff --git a/js/circle-mode.js b/js/circle-mode.js
index 492c6c6..3677f68 100644
--- a/js/circle-mode.js
+++ b/js/circle-mode.js
@@ -4,28 +4,15 @@
 
 function initCircleMode() {
   document.querySelector("#circle-mode").addEventListener('click', function() {
-    if(circleMode) {
-      circleMode = false;
-      document.querySelector("#circle-mode i").innerText = "trip_origin";
+    circleMode = !circleMode;
+    document.querySelector("#circle-mode i").innerText = (circleMode ? "scatter_plot" : "trip_origin");
+    s.graph.nodes().forEach(function(n) {
+      n.x = (circleMode ? n.circleX : n.originalX);
+      n.y = (circleMode ? n.circleY : n.originalY);
+      n.size = 10;
+    });
 
-      s.graph.nodes().forEach(function(n) {
-        n.x = n.originalX;
-        n.y = n.originalY;
-        n.size = 10;
-      });
-
-      s.refresh();
-    } else {
-      circleMode = true;
-      document.querySelector("#circle-mode i").innerText = "scatter_plot";
-
-      s.graph.nodes().forEach(function(n) {
-        n.x = n.circleX;
-        n.y = n.circleY;
-      });
-
-      s.refresh();
-    }
+    s.refresh();
   });
 }
 
@@ -34,10 +21,10 @@
   if (y < -10000 || y > 10000) return true;
 
   var ans = true;
-  var c = crossProd (rect[0], rect[1], x, y);
+  var c = crossProd(rect[0], rect[1], x, y);
 
-  for(var i = 1; i < 4; i++) {
-    var temp = crossProd (rect[i], rect[(i+1)%4], x, y);
+  for (var i = 1; i < 4; i++) {
+    var temp = crossProd(rect[i], rect[(i+1)%4], x, y);
     if (c*temp < 0) ans = false;
   }
   return ans;
diff --git a/js/graf.js b/js/graf.js
index 2b1b1f8..39c9295 100644
--- a/js/graf.js
+++ b/js/graf.js
@@ -70,7 +70,7 @@
 
     var sizegraf = 0;
     for (var i in graf.nodes) {
-      if ( isInRect(graf.nodes[i].x, graf.nodes[i].y, rectBorrar) ) continue;
+      if (isInRect(graf.nodes[i].x, graf.nodes[i].y, rectBorrar)) continue;
       sizegraf++;
     }
     var nnode = 0;
@@ -84,8 +84,8 @@
       // post-processing for year corrections
       if(1970 < graf.nodes[i].year && graf.nodes[i].year < 2004) graf.nodes[i].year += 18;
 
-      var newX = 5000*Math.cos( 2*Math.PI*nnode/sizegraf );
-      var newY = 5000*Math.sin( 2*Math.PI*nnode/sizegraf );
+      var newX = 5000*Math.cos( 2*Math.PI*nnode/sizegraf ) + 725;
+      var newY = 5000*Math.sin( 2*Math.PI*nnode/sizegraf ) + 800;
 
       if (isInRect(graf.nodes[i].x, graf.nodes[i].y, rectBorrar) ) continue;
 
diff --git a/js/script.js b/js/script.js
index bceb329..feeabe8 100644
--- a/js/script.js
+++ b/js/script.js
@@ -4,28 +4,15 @@
 
 function initCircleMode() {
   document.querySelector("#circle-mode").addEventListener('click', function() {
-    if(circleMode) {
-      circleMode = false;
-      document.querySelector("#circle-mode i").innerText = "trip_origin";
+    circleMode = !circleMode;
+    document.querySelector("#circle-mode i").innerText = (circleMode ? "scatter_plot" : "trip_origin");
+    s.graph.nodes().forEach(function(n) {
+      n.x = (circleMode ? n.circleX : n.originalX);
+      n.y = (circleMode ? n.circleY : n.originalY);
+      n.size = 10;
+    });
 
-      s.graph.nodes().forEach(function(n) {
-        n.x = n.originalX;
-        n.y = n.originalY;
-        n.size = 10;
-      });
-
-      s.refresh();
-    } else {
-      circleMode = true;
-      document.querySelector("#circle-mode i").innerText = "scatter_plot";
-
-      s.graph.nodes().forEach(function(n) {
-        n.x = n.circleX;
-        n.y = n.circleY;
-      });
-
-      s.refresh();
-    }
+    s.refresh();
   });
 }
 
@@ -34,10 +21,10 @@
   if (y < -10000 || y > 10000) return true;
 
   var ans = true;
-  var c = crossProd (rect[0], rect[1], x, y);
+  var c = crossProd(rect[0], rect[1], x, y);
 
-  for(var i = 1; i < 4; i++) {
-    var temp = crossProd (rect[i], rect[(i+1)%4], x, y);
+  for (var i = 1; i < 4; i++) {
+    var temp = crossProd(rect[i], rect[(i+1)%4], x, y);
     if (c*temp < 0) ans = false;
   }
   return ans;
@@ -118,7 +105,7 @@
 
     var sizegraf = 0;
     for (var i in graf.nodes) {
-      if ( isInRect(graf.nodes[i].x, graf.nodes[i].y, rectBorrar) ) continue;
+      if (isInRect(graf.nodes[i].x, graf.nodes[i].y, rectBorrar)) continue;
       sizegraf++;
     }
     var nnode = 0;
@@ -132,8 +119,8 @@
       // post-processing for year corrections
       if(1970 < graf.nodes[i].year && graf.nodes[i].year < 2004) graf.nodes[i].year += 18;
 
-      var newX = 5000*Math.cos( 2*Math.PI*nnode/sizegraf );
-      var newY = 5000*Math.sin( 2*Math.PI*nnode/sizegraf );
+      var newX = 5000*Math.cos( 2*Math.PI*nnode/sizegraf ) + 725;
+      var newY = 5000*Math.sin( 2*Math.PI*nnode/sizegraf ) + 800;
 
       if (isInRect(graf.nodes[i].x, graf.nodes[i].y, rectBorrar) ) continue;
 
