diff --git a/Geo/MElement.h b/Geo/MElement.h
index 597f9938308f5917149efef033637895592c785d..04a55d28bc5ce946960d4d71e3c2df8755430dfb 100644
--- a/Geo/MElement.h
+++ b/Geo/MElement.h
@@ -1015,10 +1015,11 @@ class MHexahedron20 : public MHexahedron {
     tmp = _v[4]; _v[4] = _v[6]; _v[6] = tmp;
     MVertex *old[12];
     for(int i = 0; i < 12; i++) old[i] = _vs[i];
-    _vs[0] = old[3]; _vs[1] = old[5]; _vs[2] = old[6];
-    _vs[3] = old[0]; _vs[4] = old[4]; _vs[5] = old[1];
-    _vs[6] = old[2]; _vs[7] = old[7]; _vs[8] = old[10];
-    _vs[9] = old[11]; _vs[10] = old[8]; _vs[11] = old[9];
+    _vs[0] = old[3]; _vs[3] = old[0];
+    _vs[1] = old[5]; _vs[5] = old[1];
+    _vs[2] = old[6]; _vs[6] = old[2];
+    _vs[8] = old[10]; _vs[10] = old[8];
+    _vs[9] = old[11]; _vs[11] = old[9];
   }
 };
 
@@ -1102,12 +1103,17 @@ class MHexahedron27 : public MHexahedron {
     MVertex *tmp;
     tmp = _v[0]; _v[0] = _v[2]; _v[2] = tmp;
     tmp = _v[4]; _v[4] = _v[6]; _v[6] = tmp;
-    MVertex *old[12];
-    for(int i = 0; i < 12; i++) old[i] = _vs[i];
-    _vs[0] = old[3]; _vs[1] = old[5]; _vs[2] = old[6];
-    _vs[3] = old[0]; _vs[4] = old[4]; _vs[5] = old[1];
-    _vs[6] = old[2]; _vs[7] = old[7]; _vs[8] = old[10];
-    _vs[9] = old[11]; _vs[10] = old[8]; _vs[11] = old[9];
+    MVertex *old[19];
+    for(int i = 0; i < 19; i++) old[i] = _vs[i];
+    // edge vertices
+    _vs[0] = old[3]; _vs[3] = old[0];
+    _vs[1] = old[5]; _vs[5] = old[1];
+    _vs[2] = old[6]; _vs[6] = old[2];
+    _vs[8] = old[10]; _vs[10] = old[8];
+    _vs[9] = old[11]; _vs[11] = old[9];
+    // face vertices
+    _vs[13] = old[15]; _vs[15] = old[13];
+    _vs[14] = old[16]; _vs[16] = old[14];
   }
 };
 
@@ -1351,9 +1357,12 @@ class MPrism18 : public MPrism {
     MVertex *tmp;
     tmp = _v[0]; _v[0] = _v[1]; _v[1] = tmp;
     tmp = _v[3]; _v[3] = _v[4]; _v[4] = tmp;
+    // edge vertices
     tmp = _vs[1]; _vs[1] = _vs[3]; _vs[3] = tmp;
     tmp = _vs[2]; _vs[2] = _vs[4]; _vs[4] = tmp;
     tmp = _vs[7]; _vs[7] = _vs[8]; _vs[8] = tmp;
+    // quad face vertices
+    tmp = _vs[10]; _vs[10] = _vs[11]; _vs[11] = tmp;
   }
 };
 
diff --git a/Graphics/Mesh.cpp b/Graphics/Mesh.cpp
index 44fab6c1d44c6851cd4c10a924bdded3b71bdc8c..3c6ba8572e207efa06683dcf9d01065c2cc9d83d 100644
--- a/Graphics/Mesh.cpp
+++ b/Graphics/Mesh.cpp
@@ -1,4 +1,4 @@
-// $Id: Mesh.cpp,v 1.216 2008-02-26 08:28:16 geuzaine Exp $
+// $Id: Mesh.cpp,v 1.217 2008-02-27 12:39:28 geuzaine Exp $
 //
 // Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle
 //
@@ -222,6 +222,8 @@ static void drawTangents(std::vector<T*> &elements)
 
 static void drawVertexLabel(GEntity *e, MVertex *v, int partition=-1)
 {
+  if(!v->getVisibility()) return;
+
   int np = e->physicals.size();
   int physical = np ? e->physicals[np - 1] : 0;
   char str[256];
diff --git a/contrib/MathEval/Makefile b/contrib/MathEval/Makefile
index 2a3743fbc508829c64aa93bdac9a9a9707b9e621..eaeaf4abeb64df562e9ca97ec934701094d880ec 100644
--- a/contrib/MathEval/Makefile
+++ b/contrib/MathEval/Makefile
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.20 2008-02-17 08:48:09 geuzaine Exp $
+# $Id: Makefile,v 1.21 2008-02-27 12:39:28 geuzaine Exp $
 #
 # Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle
 #
@@ -55,7 +55,7 @@ clean:
 
 depend:
 	(sed '/^# DO NOT DELETE THIS LINE/q' Makefile && \
-	${CC} -MM ${CFLAGS} ${SRC} \
+	${CXX} -MM ${CFLAGS} ${SRC} \
 	) >Makefile.new
 	cp Makefile Makefile.bak
 	cp Makefile.new Makefile
diff --git a/doc/VERSIONS b/doc/VERSIONS
index 43b00132e1872194cfd9e51069ed330a99ad2954..9d5e0c608fc972652d03d31cf3635b7131345cff 100644
--- a/doc/VERSIONS
+++ b/doc/VERSIONS
@@ -1,4 +1,6 @@
-$Id: VERSIONS,v 1.397 2008-02-22 07:19:26 geuzaine Exp $
+$Id: VERSIONS,v 1.398 2008-02-27 12:39:28 geuzaine Exp $
+
+2.1.1 (Feb , 2008): small bug fixes (higher order elements)
 
 2.1.0 (Feb 23, 2008): new post-processing database; complete rewrite
 of post-processing drawing code; improved surface mesh algorithms;
diff --git a/doc/texinfo/gmsh.texi b/doc/texinfo/gmsh.texi
index 0e0587165817e17d657c23dce8c6b55390bdd0cb..6995314fb9b7e6fd5992808211e617560c407a7e 100644
--- a/doc/texinfo/gmsh.texi
+++ b/doc/texinfo/gmsh.texi
@@ -1,5 +1,5 @@
 \input texinfo.tex @c -*-texinfo-*-
-@c $Id: gmsh.texi,v 1.239 2008-02-23 22:16:32 geuzaine Exp $
+@c $Id: gmsh.texi,v 1.240 2008-02-27 12:39:28 geuzaine Exp $
 @c
 @c Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle
 @c
@@ -248,6 +248,7 @@ Gmsh post-processing file formats
 
 Programming notes
 
+* Main code structure::         
 * Coding style::                
 * Option handling::             
 
@@ -513,11 +514,6 @@ transfinite or extruded meshes;
 Gmsh is not a multi-bloc generator: all meshes produced by Gmsh are
 conforming in the sense of finite element meshes;
 @item
-the 3D unstructured algorithm is still experimental and not very robust.
-If this algorithm fail, try to change some characteristic lengths to
-generate meshes that better suit the geometrical details of the
-structures;
-@item
 Gmsh was designed to solve academic ``test cases'', not industrial-size
 problems. You may find that Gmsh is too slow for large problems (with
 thousands of geometric primitives, or millions of mesh/post-processing
@@ -3827,30 +3823,40 @@ Pyramid:
 
 @cindex Programming, notes
 
-Gmsh was originally written in C, and later enhanced with various C++
-additions. The resulting code is a hybrid C/C++ beast, hopefully not too
-badly structured... The scripting language is parsed using Lex and Yacc
-(actually, Flex and Bison), while the GUI relies on OpenGL for the 3D
-graphics and FLTK for the widget set. See @uref{http://www.opengl.org},
-@uref{http://www.mesa3d.org} and @uref{http://www.fltk.org} for more
-information.
-
-Gmsh's build system is based on autoconf, and should work on most modern
-platforms providing standard compliant C and C++ compilers. Practical
-notes on how to compile Gmsh's source code are included in the
-distribution. See @ref{Frequently asked questions}, for more
-information.
+Gmsh is written in C++, the scripting language is parsed using Lex and
+Yacc (actually, Flex and Bison), and the GUI relies on OpenGL for the 3D
+graphics and FLTK (@uref{http://www.fltk.org}) for the widget
+set. Gmsh's build system is based on autoconf. Practical notes on how to
+compile Gmsh's source code are included in the distribution. See
+@ref{Frequently asked questions}, for more information.
 
 @menu
+* Main code structure::         
 * Coding style::                
 * Option handling::             
 @end menu
 
+@c -------------------------------------------------------------------------
+@c Main code structure
+@c -------------------------------------------------------------------------
+
+@node Main code structure, Coding style, Programming notes, Programming notes
+@section Main code structure
+
+Gmsh's code is structured in several libraries, roughly separated
+between the three main core modules (Geo, Mesh, Post) and associated
+utility libraries (Common, Numeric) on one hand, and graphics (Graphics)
+and interface (Fltk, Box) libraries on the other.
+
+The geometry and mesh modules are based on an object-oriented model
+class (Geo/GModel.h), built upon abstract geometrical entity classes
+(Geo/GVertex.h, Geo/Gedge.h, Geo/GFace.h and Geo/GRegion.h).
+
 @c -------------------------------------------------------------------------
 @c Coding style
 @c -------------------------------------------------------------------------
 
-@node Coding style, Option handling, Programming notes, Programming notes
+@node Coding style, Option handling, Main code structure, Programming notes
 @section Coding style
 
 If you plan to contribute code to the Gmsh project, here are some easy rules
@@ -3877,9 +3883,10 @@ To add a new option in Gmsh:
 
 @enumerate
 @item
-create the option in the @code{Context_T} class (@file{Common/Context.h}) if
-it's a classical option, or in the @code{Post_View} class
-(@file{Common/View.h}) if it's a post-processing view-dependent option;
+create the option in the @code{Context_T} class
+(@file{Common/Context.h}) if it's a classical option, or in the
+@code{PViewOptions} class (@file{Post/PViewOptions.h}) if it's a
+post-processing view-dependent option;
 @item
 in @file{Common/DefaultOptions.h}, give a name (for the parser to be able to
 access it), a reference to a handling routine (i.e. @code{opt_XXX}) and a
@@ -3897,6 +3904,8 @@ option panel (in @file{Fltk/Callbacks.cpp}).
 
 @c todo:
 @c Tools to check memory leaks
+@c * on mac: use GMALLOC
+     (gdb) set env DYLD_INSERT_LIBRARIES /usr/lib/libgmalloc.dylib
 @c * LIBNJAMD
 @c   export LD_PRELOAD=libnjamd.so
 @c   kill -USR1
@@ -3996,7 +4005,7 @@ You will then be able to access the documentation with the command
 directly. For example, @code{info gmsh surfaces} or @code{info gmsh surf}
 will take you directly to @ref{Surfaces}.
 @item
-Use emacs to edit your files, and load the C++ mode! This permits automatic
+Use emacs to edit your files, and load the C++ mode. This permits automatic
 syntax highlighting and easy indentation. Automatic loading of the C++ mode
 for @file{.geo} files can be achieved by adding the following command in
 your @code{.emacs} file: @code{(setq auto-mode-alist (append '(("\\.geo$"