diff --git a/js/fea/dmaCell.js b/js/fea/dmaCell.js
index 7eb85b92740ed9e1a56610769746d4bbf91f4a67..b6592bd6be35549ddeeac9f6dd2e4579cacbaeda 100644
--- a/js/fea/dmaCell.js
+++ b/js/fea/dmaCell.js
@@ -51,8 +51,8 @@
         position.x = indices.x*scale;
         position.y = indices.y*triHeight;
         position.z = indices.z*octHeight;
-        if (indices.y%2 == 1) position.x -= scale/2;
-        if (indices.z%2 == 1) position.y -= triHeight*4/3;
+        if (Math.abs(indices.y%2) == 1) position.x -= scale/2;
+        if (Math.abs(indices.z%2) == 1) position.y -= triHeight*4/3;
         return position;
     };