diff --git a/js/fea/DmaCell.js b/js/fea/DmaCell.js
index 9963ff0f3947e6987006691866c7308a26bc8d3e..26d0418bca0156d68a850e496b6260a8c05b500f 100644
--- a/js/fea/DmaCell.js
+++ b/js/fea/DmaCell.js
@@ -64,6 +64,10 @@ DMACell.prototype._setMeshPosition = function(mesh, position){
     mesh.position.z = position.z;
 };
 
+DMACell.prototype.getType = function(){
+    return null;//only used in freeform layout
+}
+
 DMACell.prototype.getScale = function(){//need for part relay
     return dmaGlobals.lattice.get("scale");
 };
@@ -187,10 +191,11 @@ DMACell.prototype.toJSON = function(){
     self.DMAEdgeOctaCell = DMAEdgeOctaCell;
 
 
-    function DMAFreeFormOctaCell(indices, scale, parentCellPos, parentCellQuat, direction){
+    function DMAFreeFormOctaCell(indices, scale, parentCellPos, parentCellQuat, direction, parentType){
         this.parentPos = parentCellPos;
         this.parentQuaternion = parentCellQuat;
         this.parentDirection = direction;
+        this.parentType = parentType;
         DMAFaceOctaCell.call(this, indices, scale);
     }
     DMAFreeFormOctaCell.prototype = Object.create(DMAFaceOctaCell.prototype);
@@ -203,8 +208,8 @@ DMACell.prototype.toJSON = function(){
         var quaternion = new THREE.Quaternion().setFromUnitVectors(zAxis, direction);
         quaternion.multiply(this.parentQuaternion);
 
-        if (direction.sub(zAxis).length() < 0.1){
-            var zRot = new THREE.Quaternion().setFromAxisAngle(zAxis, Math.PI);
+        if ((this.parentType == "octa" && direction.sub(zAxis).length() < 0.1) || this.parentType == "tetra"){
+            var zRot = new THREE.Quaternion().setFromAxisAngle(this.parentDirection, Math.PI);
             zRot.multiply(quaternion);
             quaternion = zRot;
         }
@@ -213,6 +218,10 @@ DMACell.prototype.toJSON = function(){
         mesh.rotation.set(eulerRot.x, eulerRot.y, eulerRot.z);
     };
 
+    DMAFreeFormOctaCell.prototype.getType = function(){
+        return "octa";
+    };
+
     DMAFreeFormOctaCell.prototype.calcHighlighterPosition = function(face){
         var direction = face.normal.clone();
         direction.applyQuaternion(this.cellMesh.quaternion);
@@ -245,9 +254,9 @@ DMACell.prototype.toJSON = function(){
         _.extend(json, {
             parentPosition: this.parentPos,
             parentOrientation: this.parentQuaternion,
-            direction: this.parentDirection
-//            position: this.getPosition(),
-//            orientation: this.getOrientation()
+            direction: this.parentDirection,
+            parentType: this.parentType,
+            type: "octa"
         });
         return json;
     }
@@ -295,10 +304,11 @@ DMACell.prototype.toJSON = function(){
     unitCellGeo2.applyMatrix(new THREE.Matrix4().makeRotationZ(Math.PI/4));
     unitCellGeo2.applyMatrix(new THREE.Matrix4().makeRotationX((Math.PI-Math.atan(2*Math.sqrt(2)))/2));
 
-    function DMAFreeFormTetraCell(indices, scale, parentCellPos, parentCellQuat, direction){
+    function DMAFreeFormTetraCell(indices, scale, parentCellPos, parentCellQuat, direction, parentType){
         this.parentPos = parentCellPos;
         this.parentQuaternion = parentCellQuat;
         this.parentDirection = direction;
+        this.parentType = parentType;
         DMATetraFaceCell.call(this, indices, scale);
     }
     DMAFreeFormTetraCell.prototype = Object.create(DMATetraFaceCell.prototype);
@@ -307,6 +317,10 @@ DMACell.prototype.toJSON = function(){
         return this._superBuildCellMesh(unitCellGeo2);
     };
 
+    DMAFreeFormTetraCell.prototype.getType = function(){
+        return "tetra";
+    };
+
     DMAFreeFormTetraCell.prototype._doMeshTransformations = function(mesh){
         var direction = this.parentDirection.clone();
         var zAxis = new THREE.Vector3(0,0,1);
@@ -314,6 +328,12 @@ DMACell.prototype.toJSON = function(){
         var quaternion = new THREE.Quaternion().setFromUnitVectors(zAxis, direction);
         quaternion.multiply(this.parentQuaternion);
 
+        if (this.parentType == "octa" && direction.sub(zAxis).length() > 0.1){//only do this if connecting to octa
+            var zRot = new THREE.Quaternion().setFromAxisAngle(this.parentDirection, Math.PI);
+            zRot.multiply(quaternion);
+            quaternion = zRot;
+        }
+
         var eulerRot = new THREE.Euler().setFromQuaternion(quaternion);
         mesh.rotation.set(eulerRot.x, eulerRot.y, eulerRot.z);
     };
@@ -346,6 +366,18 @@ DMACell.prototype.toJSON = function(){
         return 2*scale/Math.sqrt(24);
     };
 
+    DMAFreeFormTetraCell.prototype.toJSON = function(){
+        var json = DMACell.prototype.toJSON.call(this);
+        _.extend(json, {
+            parentPosition: this.parentPos,
+            parentOrientation: this.parentQuaternion,
+            direction: this.parentDirection,
+            parentType: this.parentType,
+            type: "tetra"
+        });
+        return json;
+    }
+
     self.DMAFreeFormTetraCell = DMAFreeFormTetraCell;
 
 
diff --git a/js/models/BasePlane.js b/js/models/BasePlane.js
index 81a01e14109399fca808d963849742084245dc6a..a35258e97a0908408eae46a5381363779c0fd2ca 100644
--- a/js/models/BasePlane.js
+++ b/js/models/BasePlane.js
@@ -40,7 +40,11 @@ BasePlane = Backbone.Model.extend({
     },
 
     getOrientation: function(){
-        return new THREE.Quaternion().setFromAxisAngle(new THREE.Vector3(0,0,1), Math.PI);;
+        return new THREE.Quaternion().setFromAxisAngle(new THREE.Vector3(0,0,1), Math.PI);
+    },
+
+    getType: function(){
+        return "octa";
     },
 
 //    _renderForCurrentScene: function(){
diff --git a/js/models/Lattice.js b/js/models/Lattice.js
index 3a25b049c7d1a24e918931bef4876aa1c3a7ce4e..366a394ab695e1244bbc2871c7e85f0be71fe9c7 100644
--- a/js/models/Lattice.js
+++ b/js/models/Lattice.js
@@ -408,9 +408,11 @@ Lattice = Backbone.Model.extend({
                 if (cell.parentOrientation) var parentOrientation = new THREE.Quaternion(cell.parentOrientation._x, cell.parentOrientation._y, cell.parentOrientation._z, cell.parentOrientation._w);
                 if (cell.parentPosition) var parentPos = cell.parentPosition;
                 if (cell.direction) var direction = new THREE.Vector3(cell.direction.x, cell.direction.y, cell.direction.z);
+                if (cell.parentType) var parentType = cell.parentType;
+                if (cell.type) var type = cell.type;
 
                 if (cell.destroy) cell.destroy();
-                var newCell = self._makeCellForLatticeType(index, scale, parentPos, parentOrientation, direction);
+                var newCell = self._makeCellForLatticeType(index, scale, parentPos, parentOrientation, direction, parentType, type);
 
                 if (parts) {
                     //todo make this better
@@ -650,17 +652,21 @@ Lattice = Backbone.Model.extend({
 
         },
 
-        addFreeFormCell: function(parentCellPos, parentCellOrient, direction){
+        addFreeFormCell: function(parentCellPos, parentCellOrient, direction, parentType, type){
             var scale = this.get("scale");
             var cells = this.get("cells");
-            cells[0][0].push(this._makeCellForLatticeType({x:0,y:0,z:cells[0][0].length}, scale, parentCellPos, parentCellOrient, direction));
+            cells[0][0].push(this._makeCellForLatticeType({x:0,y:0,z:cells[0][0].length}, scale, parentCellPos, parentCellOrient, direction, parentType, type));
             this.set("numCells", this.get("numCells")+1);
             dmaGlobals.three.render();
         },
 
-        _makeCellForLatticeType: function(index, scale, parentPosition, parentOrientation, direction){
-            if (this.get("freeformCellType") == "octa") return new DMAFreeFormOctaCell(index, scale, parentPosition, parentOrientation, direction);
-            return new DMAFreeFormTetraCell(index, scale, parentPosition, parentOrientation, direction);
+        _makeCellForLatticeType: function(index, scale, parentPosition, parentOrientation, direction, parentType, type){
+            if (type){
+                if (type == "octa") return new DMAFreeFormOctaCell(index, scale, parentPosition, parentOrientation, direction, parentType);
+                return new DMAFreeFormTetraCell(index, scale, parentPosition, parentOrientation, direction, parentType);
+            }
+            if (this.get("freeformCellType") == "octa") return new DMAFreeFormOctaCell(index, scale, parentPosition, parentOrientation, direction, parentType);
+            return new DMAFreeFormTetraCell(index, scale, parentPosition, parentOrientation, direction, parentType);
         },
 
         getIndexForPosition: function(absPosition){//only used by baseplane
diff --git a/js/threeViews/Highlighter.js b/js/threeViews/Highlighter.js
index 264fc15818be9ffa6fb5997d3af7aaa3266b6bfb..4229989fe3b138ffb4e4bc2121bd99d4bc557711 100644
--- a/js/threeViews/Highlighter.js
+++ b/js/threeViews/Highlighter.js
@@ -111,7 +111,7 @@ Highlighter = Backbone.View.extend({
             if (!this.isVisible() || !this.highlightedObject) return;
             if (dmaGlobals.lattice.get("connectionType") == "freeformFace"){
                 //todo make this work for baseplane
-                dmaGlobals.lattice.addFreeFormCell(this.mesh.position.clone(), this.highlightedObject.getOrientation(), this.direction);
+                dmaGlobals.lattice.addFreeFormCell(this.mesh.position.clone(), this.highlightedObject.getOrientation(), this.direction, this.highlightedObject.getType());
                 return;
             }
             dmaGlobals.lattice.addCellAtIndex(this._getNextCellPosition());