diff --git a/MeshLib/Elements/Edge.h b/MeshLib/Elements/Edge.h
index 4d78168ff2b5756a88c6473b70abdb7e50e2aa89..ac2125887088a84b43fa53943fae154d86681232 100644
--- a/MeshLib/Elements/Edge.h
+++ b/MeshLib/Elements/Edge.h
@@ -16,10 +16,12 @@
 #include <limits>
 
 #include "Element.h"
+#include "Node.h"
+
+#include "MathTools.h"
 
-namespace MeshLib {
 
-class Node;
+namespace MeshLib {
 
 /**
  * A 1d Edge or Line Element.
@@ -27,20 +29,30 @@ class Node;
  *  0--------1
  * @endcode
  */
-class Edge : public Element
+template <unsigned ORDER, unsigned NNODES>
+class TemplateEdge : public Element
 {
 public:
 	/// Constructor with an array of mesh nodes.
-	Edge(Node* nodes[2], unsigned value = 0);
-
-	/// Constructor using single nodes
-	Edge(Node* n1, Node* n2, unsigned value = 0);
+	TemplateEdge(Node* nodes[NNODES], unsigned value = 0) :
+		Element(value)
+	{
+		_nodes = nodes;
+		this->_length = this->computeVolume();
+	}
 
 	/// Copy constructor
-	Edge(const Edge &edge);
+	TemplateEdge(const TemplateEdge<ORDER, NNODES> &edge) :
+		Element(edge.getValue())
+	{
+		_nodes = new Node*[NNODES];
+		for (unsigned k(0); k<NNODES; k++)
+			_nodes[k] = edge._nodes[k];
+		_length = edge.getLength();
+	}
 
 	/// Destructor
-	virtual ~Edge();
+	virtual ~TemplateEdge() {};
 
 	/// Returns the length, area or volume of a 1D, 2D or 3D element
 	double getContent() const { return _length; };
@@ -73,7 +85,10 @@ public:
 	unsigned getNNeighbors() const { return 0; };
 
 	/// Get the number of nodes for this element.
-	virtual unsigned getNNodes() const { return 2; };
+	virtual unsigned getNNodes(unsigned order) const
+	{
+		return order == ORDER ? NNODES : 2;
+	}
 
 	/**
 	 * Method returns the type of the element. In this case EDGE will be returned.
@@ -81,19 +96,38 @@ public:
 	 */
 	virtual MshElemType::type getType() const { return MshElemType::EDGE; }
 
-	/// Returns true if these two indeces form an edge and false otherwise
-	bool isEdge(unsigned i, unsigned j) const;
+	/// Returns true if these two indices form an edge and false otherwise
+	bool isEdge(unsigned idx1, unsigned idx2) const
+	{
+		if (0==idx1 && 1==idx2) return true;
+		if (1==idx1 && 0==idx2) return true;
+		return false;
+	}
 
-	virtual Element* clone() const;
+	virtual Element* clone() const
+	{
+		return new TemplateEdge<ORDER,NNODES>(*this);
+	}
 
 	/**
 	 * If for instance two nodes of the element are collapsed the Edge element disappears.
 	 * @return NULL
 	 */
-	virtual Element* reviseElement() const;
+	virtual Element* reviseElement() const
+	{
+		if (_nodes[0] == _nodes[1]) {
+			return NULL;
+		}
+
+		return NULL;
+	}
 
 protected:
-	double computeVolume();
+	double computeVolume()
+	{
+		return sqrt(MathLib::sqrDist(_nodes[0]->getCoords(), _nodes[1]->getCoords()));
+	}
+
 	/// 1D elements have no edges.
 	Node* getEdgeNode(unsigned edge_id, unsigned node_id) const { (void)edge_id; (void)node_id; return NULL; };
 
@@ -107,6 +141,8 @@ protected:
 
 }; /* class */
 
+typedef TemplateEdge<1,2> Edge;
+
 } /* namespace */
 
 #endif /* EDGE_H_ */
diff --git a/MeshLib/Elements/Element.h b/MeshLib/Elements/Element.h
index 2b896aa6a1dc3dcbef40c23a0113575a13bff4d7..3f43902829a2f99c17632e03cf6e047f4ce309c4 100644
--- a/MeshLib/Elements/Element.h
+++ b/MeshLib/Elements/Element.h
@@ -88,8 +88,12 @@ public:
 	/// Get the number of neighbors for this element.
 	virtual unsigned getNNeighbors() const = 0;
 
-	/// Get the number of nodes for this element.
-	virtual unsigned getNNodes() const = 0;
+	/**
+	 * Get the number of nodes for this element with respect to the order.
+	 * @param order (default = 1)
+	 * @return the number of nodes with respect to the order.
+	 */
+	virtual unsigned getNNodes(unsigned order = 1) const = 0;
 
 	/// Returns the position of the given node in the node array of this element.
 	virtual unsigned getNodeIDinElement(const MeshLib::Node* node) const;
diff --git a/MeshLib/Elements/Hex.h b/MeshLib/Elements/Hex.h
index 14943ec47a3b1f5f95f75c57dfa68a3c330417cd..c718a8a9dba3a113768eecc6f97f6cf4427b562e 100644
--- a/MeshLib/Elements/Hex.h
+++ b/MeshLib/Elements/Hex.h
@@ -73,7 +73,7 @@ public:
 	unsigned getNNeighbors() const { return 6; };
 
 	/// Get the number of nodes for this element.
-	virtual unsigned getNNodes() const { return 8; };
+	virtual unsigned getNNodes(unsigned order = 1) const { return 8; };
 
 	/**
 	 * Method returns the type of the element. In this case HEXAHEDRON will be returned.
diff --git a/MeshLib/Elements/Prism.h b/MeshLib/Elements/Prism.h
index 785283715fb1db3c70157c1ced2d6133ef7f4f3a..a0dd71eb1611ecf09dc2a72beefd59955f7b7fba 100644
--- a/MeshLib/Elements/Prism.h
+++ b/MeshLib/Elements/Prism.h
@@ -71,7 +71,7 @@ public:
 	unsigned getNNeighbors() const { return 5; };
 
 	/// Get the number of nodes for this element.
-	virtual unsigned getNNodes() const { return 6; };
+	virtual unsigned getNNodes(unsigned order) const { return 6; };
 
 	/**
 	 * Method returns the type of the element. In this case PRISM will be returned.
diff --git a/MeshLib/Elements/Pyramid.h b/MeshLib/Elements/Pyramid.h
index 97d818035bb80325571784703fdc28838067654e..c858ce8c2f273fccebcd999b99114af0ae8a5110 100644
--- a/MeshLib/Elements/Pyramid.h
+++ b/MeshLib/Elements/Pyramid.h
@@ -69,7 +69,7 @@ public:
 	unsigned getNNeighbors() const { return 5; };
 
 	/// Get the number of nodes for this element.
-	virtual unsigned getNNodes() const { return 5; };
+	virtual unsigned getNNodes(unsigned order = 1) const { return 5; };
 
 	/**
 	 * Method returns the type of the element. In this case PYRAMID will be returned.
diff --git a/MeshLib/Elements/Quad.h b/MeshLib/Elements/Quad.h
index e5a8d798b4cfa3793775805a4a9ddaea4199fbb5..efed7f2e0b677d62f9b1a36c60fcfcfb3eaff1ae 100644
--- a/MeshLib/Elements/Quad.h
+++ b/MeshLib/Elements/Quad.h
@@ -54,7 +54,7 @@ public:
 	unsigned getNNeighbors() const { return 4; };
 
 	/// Get the number of nodes for this element.
-	virtual unsigned getNNodes() const { return 4; };
+	virtual unsigned getNNodes(unsigned order = 1) const { return 4; };
 
 	/**
 	 * Method returns the type of the element. In this case QUAD will be returned.
diff --git a/MeshLib/Elements/Tet.h b/MeshLib/Elements/Tet.h
index 4958fcea391183309a0e27388592f11e5ef27694..7df82bbe3d2f87883fae1b7d2c644b8dee42ee67 100644
--- a/MeshLib/Elements/Tet.h
+++ b/MeshLib/Elements/Tet.h
@@ -68,7 +68,7 @@ public:
 	unsigned getNNeighbors() const { return 4; };
 
 	/// Get the number of nodes for this element.
-	virtual unsigned getNNodes() const { return 4; };
+	virtual unsigned getNNodes(unsigned order = 1) const { return 4; };
 
 	/**
 	 * Method returns the type of the element. In this case TETRAHEDRON will be returned.
diff --git a/MeshLib/Elements/Tet10.h b/MeshLib/Elements/Tet10.h
index a33a86d24e3aec2a17341e23fcdbf9aea587d33f..072dd208df30ddc6ff5ea24c8afe238f3d4e868d 100644
--- a/MeshLib/Elements/Tet10.h
+++ b/MeshLib/Elements/Tet10.h
@@ -59,7 +59,7 @@ public:
 	virtual ~Tet10();
 
 	/// Get the number of nodes for this element.
-	unsigned getNNodes() const { return 10; };
+	unsigned getNNodes(unsigned order = 1) const { return 10; };
 
 	/**
 	 * Method returns the type of the element. In this case TETRAHEDRON will be returned.
diff --git a/MeshLib/Elements/Tri.cpp b/MeshLib/Elements/Tri.cpp
index 4ff9fb8561ebff2f4700ce63046338cbee4d3083..277099c680368715ba05e5a7e8acee08182e96ae 100644
--- a/MeshLib/Elements/Tri.cpp
+++ b/MeshLib/Elements/Tri.cpp
@@ -106,11 +106,17 @@ Element* Tri::reviseElement() const
 {
 	// try to create an edge
 	if (_nodes[0] == _nodes[1] || _nodes[1] == _nodes[2]) {
-		return new Edge(_nodes[0], _nodes[2], _value);
+		Node** nodes (new Node*[2]);
+		nodes[0] = _nodes[0];
+		nodes[1] = _nodes[2];
+		return new Edge(nodes, _value);
 	}
 
 	if (_nodes[0] == _nodes[2]) {
-		return new Edge(_nodes[0], _nodes[1], _value);
+		Node** nodes (new Node*[2]);
+		nodes[0] = _nodes[0];
+		nodes[1] = _nodes[1];
+		return new Edge(nodes, _value);
 	}
 
 	return NULL;
diff --git a/MeshLib/Elements/Tri.h b/MeshLib/Elements/Tri.h
index b4cc0da6d9afa249bf02345f55586e73a94c8936..496a1e2275ffffc379d9f6bf36e3fdedcdd689ac 100644
--- a/MeshLib/Elements/Tri.h
+++ b/MeshLib/Elements/Tri.h
@@ -56,7 +56,7 @@ public:
 	unsigned getNNeighbors() const { return 3; };
 
 	/// Get the number of nodes for this element.
-	virtual unsigned getNNodes() const { return 3; };
+	virtual unsigned getNNodes(unsigned order = 1) const { return 3; };
 
 	/**
 	 * Method returns the type of the element. In this case TRIANGLE will be returned.
@@ -64,7 +64,7 @@ public:
 	 */
 	virtual MshElemType::type getType() const { return MshElemType::TRIANGLE; }
 
-	/// Returns true if these two indeces form an edge and false otherwise
+	/// Returns true if these two indices form an edge and false otherwise
 	bool isEdge(unsigned i, unsigned j) const;
 
 	/**