diff --git a/AMDiS/Makefile.in b/AMDiS/Makefile.in
index e9c5bf1ac8d8fe42b6542b15014796a2e5651527..e7566807f6e3333475b563ca70bfe29bceffb31e 100644
--- a/AMDiS/Makefile.in
+++ b/AMDiS/Makefile.in
@@ -140,6 +140,7 @@ PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
 PETSC_DIR = @PETSC_DIR@
 RANLIB = @RANLIB@
+SED = @SED@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
 STRIP = @STRIP@
diff --git a/AMDiS/aclocal.m4 b/AMDiS/aclocal.m4
index c6b83dae620f453eff109d72b180b3a18307599f..6cec4be818e153e5623e6e61d48999b94d619b09 100644
--- a/AMDiS/aclocal.m4
+++ b/AMDiS/aclocal.m4
@@ -1578,10 +1578,27 @@ linux*)
   # before this can be enabled.
   hardcode_into_libs=yes
 
+  # find out which ABI we are using
+  libsuff=
+  case "$host_cpu" in
+  x86_64*|s390x*|powerpc64*)
+    echo '[#]line __oline__ "configure"' > conftest.$ac_ext
+    if AC_TRY_EVAL(ac_compile); then
+      case `/usr/bin/file conftest.$ac_objext` in
+      *64-bit*)
+        libsuff=64
+        sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}"
+        ;;
+      esac
+    fi
+    rm -rf conftest*
+    ;;
+  esac
+
   # Append ld.so.conf contents to the search path
   if test -f /etc/ld.so.conf; then
-    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
-    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
+    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
+    sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff} $lt_ld_extra"
   fi
 
   # We used to test for /lib/ld.so.1 and disable shared libraries on
@@ -4288,6 +4305,9 @@ CC=$lt_[]_LT_AC_TAGVAR(compiler, $1)
 # Is the compiler the GNU C compiler?
 with_gcc=$_LT_AC_TAGVAR(GCC, $1)
 
+gcc_dir=\`gcc -print-file-name=. | $SED 's,/\.$,,'\`
+gcc_ver=\`gcc -dumpversion\`
+
 # An ERE matcher.
 EGREP=$lt_EGREP
 
@@ -4421,11 +4441,11 @@ striplib=$lt_striplib
 
 # Dependencies to place before the objects being linked to create a
 # shared library.
-predep_objects=$lt_[]_LT_AC_TAGVAR(predep_objects, $1)
+predep_objects=\`echo $lt_[]_LT_AC_TAGVAR(predep_objects, $1) | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
 
 # Dependencies to place after the objects being linked to create a
 # shared library.
-postdep_objects=$lt_[]_LT_AC_TAGVAR(postdep_objects, $1)
+postdep_objects=\`echo $lt_[]_LT_AC_TAGVAR(postdep_objects, $1) | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
 
 # Dependencies to place before the objects being linked to create a
 # shared library.
@@ -4437,7 +4457,7 @@ postdeps=$lt_[]_LT_AC_TAGVAR(postdeps, $1)
 
 # The library search path used internally by the compiler when linking
 # a shared library.
-compiler_lib_search_path=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_path, $1)
+compiler_lib_search_path=\`echo $lt_[]_LT_AC_TAGVAR(compiler_lib_search_path, $1) | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
 
 # Method to check whether dependent libraries are shared objects.
 deplibs_check_method=$lt_deplibs_check_method
@@ -4517,7 +4537,7 @@ variables_saved_for_relink="$variables_saved_for_relink"
 link_all_deplibs=$_LT_AC_TAGVAR(link_all_deplibs, $1)
 
 # Compile-time system search path for libraries
-sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
+sys_lib_search_path_spec=\`echo $lt_sys_lib_search_path_spec | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
 
 # Run-time system search path for libraries
 sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
@@ -6353,6 +6373,7 @@ do
     done
   done
 done
+IFS=$as_save_IFS
 lt_ac_max=0
 lt_ac_count=0
 # Add /usr/xpg4/bin/sed as it is typically found on Solaris
@@ -6385,6 +6406,7 @@ for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
 done
 ])
 SED=$lt_cv_path_SED
+AC_SUBST([SED])
 AC_MSG_RESULT([$SED])
 ])
 
diff --git a/AMDiS/bin/Makefile.in b/AMDiS/bin/Makefile.in
index 3943373753ef27eba182a749dfc7549244ada09d..aeed7614996324bc3bc2ba8806c3cba605a1f3e6 100644
--- a/AMDiS/bin/Makefile.in
+++ b/AMDiS/bin/Makefile.in
@@ -399,6 +399,7 @@ PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
 PETSC_DIR = @PETSC_DIR@
 RANLIB = @RANLIB@
+SED = @SED@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
 STRIP = @STRIP@
diff --git a/AMDiS/configure b/AMDiS/configure
index 9b59a4e4cfd55106aa11ece45f8cf9721a454bfc..4196f21be3edc261705b5fe47eb1629a18261b96 100755
--- a/AMDiS/configure
+++ b/AMDiS/configure
@@ -462,7 +462,7 @@ ac_includes_default="\
 # include <unistd.h>
 #endif"
 
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT AMDIS_DEBUG_TRUE AMDIS_DEBUG_FALSE CXX CC AMDIS_INTEL_TRUE AMDIS_INTEL_FALSE AMDIS_OPENMP_TRUE AMDIS_OPENMP_FALSE OPENMP_FLAG MPI_DIR PETSC_DIR USE_PARALLEL_AMDIS_TRUE USE_PARALLEL_AMDIS_FALSE USE_PARALLEL_DOMAIN_AMDIS_TRUE USE_PARALLEL_DOMAIN_AMDIS_FALSE ENABLE_UMFPACK_TRUE ENABLE_UMFPACK_FALSE ENABLE_MKL_TRUE ENABLE_MKL_FALSE DUNE_DIR ENABLE_DUNE_TRUE ENABLE_DUNE_FALSE ENABLE_BOOST_TRUE ENABLE_BOOST_FALSE CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE CXXFLAGS ac_ct_CXX CXXDEPMODE am__fastdepCXX_TRUE am__fastdepCXX_FALSE build build_cpu build_vendor build_os host host_cpu host_vendor host_os EGREP LN_S ECHO AR ac_ct_AR RANLIB ac_ct_RANLIB CPP CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL LIBOBJS LTLIBOBJS'
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT AMDIS_DEBUG_TRUE AMDIS_DEBUG_FALSE CXX CC AMDIS_INTEL_TRUE AMDIS_INTEL_FALSE AMDIS_OPENMP_TRUE AMDIS_OPENMP_FALSE OPENMP_FLAG MPI_DIR PETSC_DIR USE_PARALLEL_AMDIS_TRUE USE_PARALLEL_AMDIS_FALSE USE_PARALLEL_DOMAIN_AMDIS_TRUE USE_PARALLEL_DOMAIN_AMDIS_FALSE ENABLE_UMFPACK_TRUE ENABLE_UMFPACK_FALSE ENABLE_MKL_TRUE ENABLE_MKL_FALSE DUNE_DIR ENABLE_DUNE_TRUE ENABLE_DUNE_FALSE ENABLE_BOOST_TRUE ENABLE_BOOST_FALSE CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE CXXFLAGS ac_ct_CXX CXXDEPMODE am__fastdepCXX_TRUE am__fastdepCXX_FALSE build build_cpu build_vendor build_os host host_cpu host_vendor host_os SED EGREP LN_S ECHO AR ac_ct_AR RANLIB ac_ct_RANLIB CPP CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL LIBOBJS LTLIBOBJS'
 ac_subst_files=''
 
 # Initialize some variables set by options.
@@ -3946,6 +3946,7 @@ do
     done
   done
 done
+IFS=$as_save_IFS
 lt_ac_max=0
 lt_ac_count=0
 # Add /usr/xpg4/bin/sed as it is typically found on Solaris
@@ -3980,6 +3981,7 @@ done
 fi
 
 SED=$lt_cv_path_SED
+
 echo "$as_me:$LINENO: result: $SED" >&5
 echo "${ECHO_T}$SED" >&6
 
@@ -4420,7 +4422,7 @@ ia64-*-hpux*)
   ;;
 *-*-irix6*)
   # Find out which ABI we are using.
-  echo '#line 4423 "configure"' > conftest.$ac_ext
+  echo '#line 4425 "configure"' > conftest.$ac_ext
   if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
@@ -5555,7 +5557,7 @@ fi
 
 
 # Provide some information about the compiler.
-echo "$as_me:5558:" \
+echo "$as_me:5560:" \
      "checking for Fortran 77 compiler version" >&5
 ac_compiler=`set X $ac_compile; echo $2`
 { (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
@@ -6618,11 +6620,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:6621: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:6623: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:6625: \$? = $ac_status" >&5
+   echo "$as_me:6627: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
@@ -6886,11 +6888,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:6889: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:6891: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:6893: \$? = $ac_status" >&5
+   echo "$as_me:6895: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
@@ -6990,11 +6992,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:6993: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:6995: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:6997: \$? = $ac_status" >&5
+   echo "$as_me:6999: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
@@ -8455,10 +8457,31 @@ linux*)
   # before this can be enabled.
   hardcode_into_libs=yes
 
+  # find out which ABI we are using
+  libsuff=
+  case "$host_cpu" in
+  x86_64*|s390x*|powerpc64*)
+    echo '#line 8464 "configure"' > conftest.$ac_ext
+    if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+      case `/usr/bin/file conftest.$ac_objext` in
+      *64-bit*)
+        libsuff=64
+        sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}"
+        ;;
+      esac
+    fi
+    rm -rf conftest*
+    ;;
+  esac
+
   # Append ld.so.conf contents to the search path
   if test -f /etc/ld.so.conf; then
-    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
-    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
+    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
+    sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff} $lt_ld_extra"
   fi
 
   # We used to test for /lib/ld.so.1 and disable shared libraries on
@@ -9335,7 +9358,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<EOF
-#line 9338 "configure"
+#line 9361 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -9435,7 +9458,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<EOF
-#line 9438 "configure"
+#line 9461 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -9766,6 +9789,9 @@ CC=$lt_compiler
 # Is the compiler the GNU C compiler?
 with_gcc=$GCC
 
+gcc_dir=\`gcc -print-file-name=. | $SED 's,/\.$,,'\`
+gcc_ver=\`gcc -dumpversion\`
+
 # An ERE matcher.
 EGREP=$lt_EGREP
 
@@ -9899,11 +9925,11 @@ striplib=$lt_striplib
 
 # Dependencies to place before the objects being linked to create a
 # shared library.
-predep_objects=$lt_predep_objects
+predep_objects=\`echo $lt_predep_objects | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
 
 # Dependencies to place after the objects being linked to create a
 # shared library.
-postdep_objects=$lt_postdep_objects
+postdep_objects=\`echo $lt_postdep_objects | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
 
 # Dependencies to place before the objects being linked to create a
 # shared library.
@@ -9915,7 +9941,7 @@ postdeps=$lt_postdeps
 
 # The library search path used internally by the compiler when linking
 # a shared library.
-compiler_lib_search_path=$lt_compiler_lib_search_path
+compiler_lib_search_path=\`echo $lt_compiler_lib_search_path | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
 
 # Method to check whether dependent libraries are shared objects.
 deplibs_check_method=$lt_deplibs_check_method
@@ -9995,7 +10021,7 @@ variables_saved_for_relink="$variables_saved_for_relink"
 link_all_deplibs=$link_all_deplibs
 
 # Compile-time system search path for libraries
-sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
+sys_lib_search_path_spec=\`echo $lt_sys_lib_search_path_spec | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
 
 # Run-time system search path for libraries
 sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
@@ -11775,11 +11801,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:11778: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:11804: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:11782: \$? = $ac_status" >&5
+   echo "$as_me:11808: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
@@ -11879,11 +11905,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:11882: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:11908: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:11886: \$? = $ac_status" >&5
+   echo "$as_me:11912: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
@@ -12411,10 +12437,31 @@ linux*)
   # before this can be enabled.
   hardcode_into_libs=yes
 
+  # find out which ABI we are using
+  libsuff=
+  case "$host_cpu" in
+  x86_64*|s390x*|powerpc64*)
+    echo '#line 12444 "configure"' > conftest.$ac_ext
+    if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+      case `/usr/bin/file conftest.$ac_objext` in
+      *64-bit*)
+        libsuff=64
+        sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}"
+        ;;
+      esac
+    fi
+    rm -rf conftest*
+    ;;
+  esac
+
   # Append ld.so.conf contents to the search path
   if test -f /etc/ld.so.conf; then
-    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
-    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
+    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
+    sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff} $lt_ld_extra"
   fi
 
   # We used to test for /lib/ld.so.1 and disable shared libraries on
@@ -12798,6 +12845,9 @@ CC=$lt_compiler_CXX
 # Is the compiler the GNU C compiler?
 with_gcc=$GCC_CXX
 
+gcc_dir=\`gcc -print-file-name=. | $SED 's,/\.$,,'\`
+gcc_ver=\`gcc -dumpversion\`
+
 # An ERE matcher.
 EGREP=$lt_EGREP
 
@@ -12931,11 +12981,11 @@ striplib=$lt_striplib
 
 # Dependencies to place before the objects being linked to create a
 # shared library.
-predep_objects=$lt_predep_objects_CXX
+predep_objects=\`echo $lt_predep_objects_CXX | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
 
 # Dependencies to place after the objects being linked to create a
 # shared library.
-postdep_objects=$lt_postdep_objects_CXX
+postdep_objects=\`echo $lt_postdep_objects_CXX | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
 
 # Dependencies to place before the objects being linked to create a
 # shared library.
@@ -12947,7 +12997,7 @@ postdeps=$lt_postdeps_CXX
 
 # The library search path used internally by the compiler when linking
 # a shared library.
-compiler_lib_search_path=$lt_compiler_lib_search_path_CXX
+compiler_lib_search_path=\`echo $lt_compiler_lib_search_path_CXX | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
 
 # Method to check whether dependent libraries are shared objects.
 deplibs_check_method=$lt_deplibs_check_method
@@ -13027,7 +13077,7 @@ variables_saved_for_relink="$variables_saved_for_relink"
 link_all_deplibs=$link_all_deplibs_CXX
 
 # Compile-time system search path for libraries
-sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
+sys_lib_search_path_spec=\`echo $lt_sys_lib_search_path_spec | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
 
 # Run-time system search path for libraries
 sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
@@ -13449,11 +13499,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:13452: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:13502: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:13456: \$? = $ac_status" >&5
+   echo "$as_me:13506: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
@@ -13553,11 +13603,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:13556: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:13606: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:13560: \$? = $ac_status" >&5
+   echo "$as_me:13610: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
@@ -14998,10 +15048,31 @@ linux*)
   # before this can be enabled.
   hardcode_into_libs=yes
 
+  # find out which ABI we are using
+  libsuff=
+  case "$host_cpu" in
+  x86_64*|s390x*|powerpc64*)
+    echo '#line 15055 "configure"' > conftest.$ac_ext
+    if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+      case `/usr/bin/file conftest.$ac_objext` in
+      *64-bit*)
+        libsuff=64
+        sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}"
+        ;;
+      esac
+    fi
+    rm -rf conftest*
+    ;;
+  esac
+
   # Append ld.so.conf contents to the search path
   if test -f /etc/ld.so.conf; then
-    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
-    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
+    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
+    sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff} $lt_ld_extra"
   fi
 
   # We used to test for /lib/ld.so.1 and disable shared libraries on
@@ -15385,6 +15456,9 @@ CC=$lt_compiler_F77
 # Is the compiler the GNU C compiler?
 with_gcc=$GCC_F77
 
+gcc_dir=\`gcc -print-file-name=. | $SED 's,/\.$,,'\`
+gcc_ver=\`gcc -dumpversion\`
+
 # An ERE matcher.
 EGREP=$lt_EGREP
 
@@ -15518,11 +15592,11 @@ striplib=$lt_striplib
 
 # Dependencies to place before the objects being linked to create a
 # shared library.
-predep_objects=$lt_predep_objects_F77
+predep_objects=\`echo $lt_predep_objects_F77 | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
 
 # Dependencies to place after the objects being linked to create a
 # shared library.
-postdep_objects=$lt_postdep_objects_F77
+postdep_objects=\`echo $lt_postdep_objects_F77 | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
 
 # Dependencies to place before the objects being linked to create a
 # shared library.
@@ -15534,7 +15608,7 @@ postdeps=$lt_postdeps_F77
 
 # The library search path used internally by the compiler when linking
 # a shared library.
-compiler_lib_search_path=$lt_compiler_lib_search_path_F77
+compiler_lib_search_path=\`echo $lt_compiler_lib_search_path_F77 | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
 
 # Method to check whether dependent libraries are shared objects.
 deplibs_check_method=$lt_deplibs_check_method
@@ -15614,7 +15688,7 @@ variables_saved_for_relink="$variables_saved_for_relink"
 link_all_deplibs=$link_all_deplibs_F77
 
 # Compile-time system search path for libraries
-sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
+sys_lib_search_path_spec=\`echo $lt_sys_lib_search_path_spec | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
 
 # Run-time system search path for libraries
 sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
@@ -15756,11 +15830,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:15759: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:15833: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:15763: \$? = $ac_status" >&5
+   echo "$as_me:15837: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
@@ -16024,11 +16098,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:16027: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:16101: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:16031: \$? = $ac_status" >&5
+   echo "$as_me:16105: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
@@ -16128,11 +16202,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:16131: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:16205: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:16135: \$? = $ac_status" >&5
+   echo "$as_me:16209: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
@@ -17593,10 +17667,31 @@ linux*)
   # before this can be enabled.
   hardcode_into_libs=yes
 
+  # find out which ABI we are using
+  libsuff=
+  case "$host_cpu" in
+  x86_64*|s390x*|powerpc64*)
+    echo '#line 17674 "configure"' > conftest.$ac_ext
+    if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+      case `/usr/bin/file conftest.$ac_objext` in
+      *64-bit*)
+        libsuff=64
+        sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}"
+        ;;
+      esac
+    fi
+    rm -rf conftest*
+    ;;
+  esac
+
   # Append ld.so.conf contents to the search path
   if test -f /etc/ld.so.conf; then
-    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
-    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
+    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
+    sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff} $lt_ld_extra"
   fi
 
   # We used to test for /lib/ld.so.1 and disable shared libraries on
@@ -17980,6 +18075,9 @@ CC=$lt_compiler_GCJ
 # Is the compiler the GNU C compiler?
 with_gcc=$GCC_GCJ
 
+gcc_dir=\`gcc -print-file-name=. | $SED 's,/\.$,,'\`
+gcc_ver=\`gcc -dumpversion\`
+
 # An ERE matcher.
 EGREP=$lt_EGREP
 
@@ -18113,11 +18211,11 @@ striplib=$lt_striplib
 
 # Dependencies to place before the objects being linked to create a
 # shared library.
-predep_objects=$lt_predep_objects_GCJ
+predep_objects=\`echo $lt_predep_objects_GCJ | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
 
 # Dependencies to place after the objects being linked to create a
 # shared library.
-postdep_objects=$lt_postdep_objects_GCJ
+postdep_objects=\`echo $lt_postdep_objects_GCJ | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
 
 # Dependencies to place before the objects being linked to create a
 # shared library.
@@ -18129,7 +18227,7 @@ postdeps=$lt_postdeps_GCJ
 
 # The library search path used internally by the compiler when linking
 # a shared library.
-compiler_lib_search_path=$lt_compiler_lib_search_path_GCJ
+compiler_lib_search_path=\`echo $lt_compiler_lib_search_path_GCJ | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
 
 # Method to check whether dependent libraries are shared objects.
 deplibs_check_method=$lt_deplibs_check_method
@@ -18209,7 +18307,7 @@ variables_saved_for_relink="$variables_saved_for_relink"
 link_all_deplibs=$link_all_deplibs_GCJ
 
 # Compile-time system search path for libraries
-sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
+sys_lib_search_path_spec=\`echo $lt_sys_lib_search_path_spec | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
 
 # Run-time system search path for libraries
 sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
@@ -18461,6 +18559,9 @@ CC=$lt_compiler_RC
 # Is the compiler the GNU C compiler?
 with_gcc=$GCC_RC
 
+gcc_dir=\`gcc -print-file-name=. | $SED 's,/\.$,,'\`
+gcc_ver=\`gcc -dumpversion\`
+
 # An ERE matcher.
 EGREP=$lt_EGREP
 
@@ -18594,11 +18695,11 @@ striplib=$lt_striplib
 
 # Dependencies to place before the objects being linked to create a
 # shared library.
-predep_objects=$lt_predep_objects_RC
+predep_objects=\`echo $lt_predep_objects_RC | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
 
 # Dependencies to place after the objects being linked to create a
 # shared library.
-postdep_objects=$lt_postdep_objects_RC
+postdep_objects=\`echo $lt_postdep_objects_RC | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
 
 # Dependencies to place before the objects being linked to create a
 # shared library.
@@ -18610,7 +18711,7 @@ postdeps=$lt_postdeps_RC
 
 # The library search path used internally by the compiler when linking
 # a shared library.
-compiler_lib_search_path=$lt_compiler_lib_search_path_RC
+compiler_lib_search_path=\`echo $lt_compiler_lib_search_path_RC | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
 
 # Method to check whether dependent libraries are shared objects.
 deplibs_check_method=$lt_deplibs_check_method
@@ -18690,7 +18791,7 @@ variables_saved_for_relink="$variables_saved_for_relink"
 link_all_deplibs=$link_all_deplibs_RC
 
 # Compile-time system search path for libraries
-sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
+sys_lib_search_path_spec=\`echo $lt_sys_lib_search_path_spec | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
 
 # Run-time system search path for libraries
 sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
@@ -19614,6 +19715,7 @@ s,@host@,$host,;t t
 s,@host_cpu@,$host_cpu,;t t
 s,@host_vendor@,$host_vendor,;t t
 s,@host_os@,$host_os,;t t
+s,@SED@,$SED,;t t
 s,@EGREP@,$EGREP,;t t
 s,@LN_S@,$LN_S,;t t
 s,@ECHO@,$ECHO,;t t
diff --git a/AMDiS/libtool b/AMDiS/libtool
index 486eabd3eefb59bce7cb3fc38a32f6c54ef0e385..e96f67065e881c5fbc2155783211a810082e9175 100755
--- a/AMDiS/libtool
+++ b/AMDiS/libtool
@@ -30,10 +30,10 @@
 # the same distribution terms that you use for the rest of that program.
 
 # A sed program that does not truncate output.
-SED="/usr/bin/sed"
+SED="/bin/sed"
 
 # Sed that helps us avoid accidentally triggering echo(1) options like -n.
-Xsed="/usr/bin/sed -e 1s/^X//"
+Xsed="/bin/sed -e 1s/^X//"
 
 # The HP-UX ksh and POSIX shell print the target directory to stdout
 # if CDPATH is set.
@@ -44,7 +44,7 @@ available_tags=" CXX F77"
 
 # ### BEGIN LIBTOOL CONFIG
 
-# Libtool was configured on host deimos103:
+# Libtool was configured on host NWRW15:
 
 # Shell to use when invoking shell scripts.
 SHELL="/bin/sh"
@@ -66,12 +66,12 @@ fast_install=yes
 
 # The host system.
 host_alias=
-host=x86_64-unknown-linux-gnu
+host=i686-pc-linux-gnu
 host_os=linux-gnu
 
 # The build system.
 build_alias=
-build=x86_64-unknown-linux-gnu
+build=i686-pc-linux-gnu
 build_os=linux-gnu
 
 # An echo program that does not interpret backslashes.
@@ -82,22 +82,25 @@ AR="ar"
 AR_FLAGS="cru"
 
 # A C compiler.
-LTCC="/licsoft/libraries/openmpi/1.2.6/64bit/bin/mpicc"
+LTCC="gcc"
 
 # LTCC compiler flags.
 LTCFLAGS="-g -O2"
 
 # A language-specific compiler.
-CC="/licsoft/libraries/openmpi/1.2.6/64bit/bin/mpicc"
+CC="gcc"
 
 # Is the compiler the GNU C compiler?
 with_gcc=yes
 
+gcc_dir=`gcc -print-file-name=. | /bin/sed 's,/\.$,,'`
+gcc_ver=`gcc -dumpversion`
+
 # An ERE matcher.
 EGREP="grep -E"
 
 # The linker used to build libraries.
-LD="/usr/x86_64-suse-linux/bin/ld -m elf_x86_64"
+LD="/usr/bin/ld"
 
 # Whether we need hard or soft links.
 LN_S="ln -s"
@@ -171,7 +174,7 @@ dlopen_self=unknown
 dlopen_self_static=unknown
 
 # Compiler flag to prevent dynamic linking.
-link_static_flag=""
+link_static_flag="-static"
 
 # Compiler flag to turn off builtin functions.
 no_builtin_flag=" -fno-builtin"
@@ -229,11 +232,11 @@ striplib="strip --strip-unneeded"
 
 # Dependencies to place before the objects being linked to create a
 # shared library.
-predep_objects=""
+predep_objects=`echo "" | $SED -e "s@${gcc_dir}@\${gcc_dir}@g;s@${gcc_ver}@\${gcc_ver}@g"`
 
 # Dependencies to place after the objects being linked to create a
 # shared library.
-postdep_objects=""
+postdep_objects=`echo "" | $SED -e "s@${gcc_dir}@\${gcc_dir}@g;s@${gcc_ver}@\${gcc_ver}@g"`
 
 # Dependencies to place before the objects being linked to create a
 # shared library.
@@ -245,7 +248,7 @@ postdeps=""
 
 # The library search path used internally by the compiler when linking
 # a shared library.
-compiler_lib_search_path=""
+compiler_lib_search_path=`echo "" | $SED -e "s@${gcc_dir}@\${gcc_dir}@g;s@${gcc_ver}@\${gcc_ver}@g"`
 
 # Method to check whether dependent libraries are shared objects.
 deplibs_check_method="pass_all"
@@ -325,10 +328,10 @@ variables_saved_for_relink="PATH LD_LIBRARY_PATH LD_RUN_PATH GCC_EXEC_PREFIX COM
 link_all_deplibs=unknown
 
 # Compile-time system search path for libraries
-sys_lib_search_path_spec=" /usr/lib64/gcc/x86_64-suse-linux/4.1.2/ /usr/lib/gcc/x86_64-suse-linux/4.1.2/ /usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../../x86_64-suse-linux/lib/x86_64-suse-linux/4.1.2/ /usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../../x86_64-suse-linux/lib/../lib64/ /usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../x86_64-suse-linux/4.1.2/ /usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../../lib64/ /lib/x86_64-suse-linux/4.1.2/ /lib/../lib64/ /usr/lib/x86_64-suse-linux/4.1.2/ /usr/lib/../lib64/ /usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../../x86_64-suse-linux/lib/ /usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../ /lib/ /usr/lib/"
+sys_lib_search_path_spec=`echo " /usr/lib/gcc/i386-redhat-linux/4.1.2/ /usr/lib/gcc/i386-redhat-linux/4.1.2/ /usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../i386-redhat-linux/lib/i386-redhat-linux/4.1.2/ /usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../i386-redhat-linux/lib/ /usr/lib/gcc/i386-redhat-linux/4.1.2/../../../i386-redhat-linux/4.1.2/ /usr/lib/gcc/i386-redhat-linux/4.1.2/../../../ /lib/i386-redhat-linux/4.1.2/ /lib/ /usr/lib/i386-redhat-linux/4.1.2/ /usr/lib/" | $SED -e "s@${gcc_dir}@\${gcc_dir}@g;s@${gcc_ver}@\${gcc_ver}@g"`
 
 # Run-time system search path for libraries
-sys_lib_dlsearch_path_spec="/lib /usr/lib /usr/X11R6/lib64/Xaw3d /usr/X11R6/lib64 /usr/X11R6/lib/Xaw3d /usr/X11R6/lib /usr/x86_64-suse-linux/lib /usr/local/lib64 /usr/local/lib /opt/kde3/lib64 /opt/kde3/lib /opt/gnome/lib64 /opt/gnome/lib /lib64 /lib /usr/lib64 /usr/lib /opt/cluster/intel/cce/9.1.042/lib /opt/cluster/intel/fce/9.1.036/lib /opt/cluster/Pathscale3.0/lib/2.9.99 /opt/cluster/Pathscale3.0/lib/2.9.99/32 /work/licsoft/compilers/pgi/linux86-64/6.2/lib /work/licsoft/compilers/pgi/linux86-64/6.2/libso "
+sys_lib_dlsearch_path_spec="/lib /usr/lib /usr/lib/octave-2.9.9 /usr/lib/qt-3.3/lib /usr/lib/qt4/lib "
 
 # Fix the shell variable $srcfile for the compiler.
 fix_srcfile_path=""
@@ -6760,7 +6763,7 @@ build_old_libs=`case $build_libtool_libs in yes) $echo no;; *) $echo yes;; esac`
 # End:
 # ### BEGIN LIBTOOL TAG CONFIG: CXX
 
-# Libtool was configured on host deimos103:
+# Libtool was configured on host NWRW15:
 
 # Shell to use when invoking shell scripts.
 SHELL="/bin/sh"
@@ -6782,12 +6785,12 @@ fast_install=yes
 
 # The host system.
 host_alias=
-host=x86_64-unknown-linux-gnu
+host=i686-pc-linux-gnu
 host_os=linux-gnu
 
 # The build system.
 build_alias=
-build=x86_64-unknown-linux-gnu
+build=i686-pc-linux-gnu
 build_os=linux-gnu
 
 # An echo program that does not interpret backslashes.
@@ -6798,22 +6801,25 @@ AR="ar"
 AR_FLAGS="cru"
 
 # A C compiler.
-LTCC="/licsoft/libraries/openmpi/1.2.6/64bit/bin/mpicc"
+LTCC="gcc"
 
 # LTCC compiler flags.
 LTCFLAGS="-g -O2"
 
 # A language-specific compiler.
-CC="/licsoft/libraries/openmpi/1.2.6/64bit/bin/mpiCC"
+CC="g++"
 
 # Is the compiler the GNU C compiler?
 with_gcc=yes
 
+gcc_dir=`gcc -print-file-name=. | /bin/sed 's,/\.$,,'`
+gcc_ver=`gcc -dumpversion`
+
 # An ERE matcher.
 EGREP="grep -E"
 
 # The linker used to build libraries.
-LD="/usr/x86_64-suse-linux/bin/ld -m elf_x86_64"
+LD="/usr/bin/ld"
 
 # Whether we need hard or soft links.
 LN_S="ln -s"
@@ -6887,7 +6893,7 @@ dlopen_self=unknown
 dlopen_self_static=unknown
 
 # Compiler flag to prevent dynamic linking.
-link_static_flag=""
+link_static_flag="-static"
 
 # Compiler flag to turn off builtin functions.
 no_builtin_flag=" -fno-builtin"
@@ -6942,11 +6948,11 @@ striplib="strip --strip-unneeded"
 
 # Dependencies to place before the objects being linked to create a
 # shared library.
-predep_objects="/usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../../lib64/crti.o /usr/lib64/gcc/x86_64-suse-linux/4.1.2/crtbeginS.o"
+predep_objects=`echo "/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../crti.o /usr/lib/gcc/i386-redhat-linux/4.1.2/crtbeginS.o" | $SED -e "s@${gcc_dir}@\${gcc_dir}@g;s@${gcc_ver}@\${gcc_ver}@g"`
 
 # Dependencies to place after the objects being linked to create a
 # shared library.
-postdep_objects="/usr/lib64/gcc/x86_64-suse-linux/4.1.2/crtendS.o /usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../../lib64/crtn.o"
+postdep_objects=`echo "/usr/lib/gcc/i386-redhat-linux/4.1.2/crtendS.o /usr/lib/gcc/i386-redhat-linux/4.1.2/../../../crtn.o" | $SED -e "s@${gcc_dir}@\${gcc_dir}@g;s@${gcc_ver}@\${gcc_ver}@g"`
 
 # Dependencies to place before the objects being linked to create a
 # shared library.
@@ -6954,11 +6960,11 @@ predeps=""
 
 # Dependencies to place after the objects being linked to create a
 # shared library.
-postdeps="-lmpi_cxx -lmpi -lopen-rte -lopen-pal -libverbs -lrt -lnuma -ldl -lnsl -lutil -ldl -lstdc++ -lm -lgcc_s -lpthread -lc -lgcc_s"
+postdeps="-lstdc++ -lm -lgcc_s -lc -lgcc_s"
 
 # The library search path used internally by the compiler when linking
 # a shared library.
-compiler_lib_search_path="-L/usr/lib64 -L/licsoft/libraries/openmpi/1.2.6/64bit/lib -L/usr/lib64/gcc/x86_64-suse-linux/4.1.2 -L/usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../../x86_64-suse-linux/lib -L/usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../.."
+compiler_lib_search_path=`echo "-L/usr/lib/gcc/i386-redhat-linux/4.1.2 -L/usr/lib/gcc/i386-redhat-linux/4.1.2 -L/usr/lib/gcc/i386-redhat-linux/4.1.2/../../.." | $SED -e "s@${gcc_dir}@\${gcc_dir}@g;s@${gcc_ver}@\${gcc_ver}@g"`
 
 # Method to check whether dependent libraries are shared objects.
 deplibs_check_method="pass_all"
@@ -7038,10 +7044,10 @@ variables_saved_for_relink="PATH LD_LIBRARY_PATH LD_RUN_PATH GCC_EXEC_PREFIX COM
 link_all_deplibs=unknown
 
 # Compile-time system search path for libraries
-sys_lib_search_path_spec=" /usr/lib64/gcc/x86_64-suse-linux/4.1.2/ /usr/lib/gcc/x86_64-suse-linux/4.1.2/ /usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../../x86_64-suse-linux/lib/x86_64-suse-linux/4.1.2/ /usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../../x86_64-suse-linux/lib/../lib64/ /usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../x86_64-suse-linux/4.1.2/ /usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../../lib64/ /lib/x86_64-suse-linux/4.1.2/ /lib/../lib64/ /usr/lib/x86_64-suse-linux/4.1.2/ /usr/lib/../lib64/ /usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../../x86_64-suse-linux/lib/ /usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../ /lib/ /usr/lib/"
+sys_lib_search_path_spec=`echo " /usr/lib/gcc/i386-redhat-linux/4.1.2/ /usr/lib/gcc/i386-redhat-linux/4.1.2/ /usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../i386-redhat-linux/lib/i386-redhat-linux/4.1.2/ /usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../i386-redhat-linux/lib/ /usr/lib/gcc/i386-redhat-linux/4.1.2/../../../i386-redhat-linux/4.1.2/ /usr/lib/gcc/i386-redhat-linux/4.1.2/../../../ /lib/i386-redhat-linux/4.1.2/ /lib/ /usr/lib/i386-redhat-linux/4.1.2/ /usr/lib/" | $SED -e "s@${gcc_dir}@\${gcc_dir}@g;s@${gcc_ver}@\${gcc_ver}@g"`
 
 # Run-time system search path for libraries
-sys_lib_dlsearch_path_spec="/lib /usr/lib /usr/X11R6/lib64/Xaw3d /usr/X11R6/lib64 /usr/X11R6/lib/Xaw3d /usr/X11R6/lib /usr/x86_64-suse-linux/lib /usr/local/lib64 /usr/local/lib /opt/kde3/lib64 /opt/kde3/lib /opt/gnome/lib64 /opt/gnome/lib /lib64 /lib /usr/lib64 /usr/lib /opt/cluster/intel/cce/9.1.042/lib /opt/cluster/intel/fce/9.1.036/lib /opt/cluster/Pathscale3.0/lib/2.9.99 /opt/cluster/Pathscale3.0/lib/2.9.99/32 /work/licsoft/compilers/pgi/linux86-64/6.2/lib /work/licsoft/compilers/pgi/linux86-64/6.2/libso "
+sys_lib_dlsearch_path_spec="/lib /usr/lib /usr/lib/octave-2.9.9 /usr/lib/qt-3.3/lib /usr/lib/qt4/lib "
 
 # Fix the shell variable $srcfile for the compiler.
 fix_srcfile_path=""
@@ -7065,7 +7071,7 @@ include_expsyms=""
 
 # ### BEGIN LIBTOOL TAG CONFIG: F77
 
-# Libtool was configured on host deimos103:
+# Libtool was configured on host NWRW15:
 
 # Shell to use when invoking shell scripts.
 SHELL="/bin/sh"
@@ -7087,12 +7093,12 @@ fast_install=yes
 
 # The host system.
 host_alias=
-host=x86_64-unknown-linux-gnu
+host=i686-pc-linux-gnu
 host_os=linux-gnu
 
 # The build system.
 build_alias=
-build=x86_64-unknown-linux-gnu
+build=i686-pc-linux-gnu
 build_os=linux-gnu
 
 # An echo program that does not interpret backslashes.
@@ -7103,7 +7109,7 @@ AR="ar"
 AR_FLAGS="cru"
 
 # A C compiler.
-LTCC="/licsoft/libraries/openmpi/1.2.6/64bit/bin/mpicc"
+LTCC="gcc"
 
 # LTCC compiler flags.
 LTCFLAGS="-g -O2"
@@ -7112,13 +7118,16 @@ LTCFLAGS="-g -O2"
 CC="g77"
 
 # Is the compiler the GNU C compiler?
-with_gcc=
+with_gcc=yes
+
+gcc_dir=`gcc -print-file-name=. | /bin/sed 's,/\.$,,'`
+gcc_ver=`gcc -dumpversion`
 
 # An ERE matcher.
 EGREP="grep -E"
 
 # The linker used to build libraries.
-LD="/usr/x86_64-suse-linux/bin/ld -m elf_x86_64"
+LD="/usr/bin/ld"
 
 # Whether we need hard or soft links.
 LN_S="ln -s"
@@ -7250,11 +7259,11 @@ striplib="strip --strip-unneeded"
 
 # Dependencies to place before the objects being linked to create a
 # shared library.
-predep_objects=""
+predep_objects=`echo "" | $SED -e "s@${gcc_dir}@\${gcc_dir}@g;s@${gcc_ver}@\${gcc_ver}@g"`
 
 # Dependencies to place after the objects being linked to create a
 # shared library.
-postdep_objects=""
+postdep_objects=`echo "" | $SED -e "s@${gcc_dir}@\${gcc_dir}@g;s@${gcc_ver}@\${gcc_ver}@g"`
 
 # Dependencies to place before the objects being linked to create a
 # shared library.
@@ -7266,7 +7275,7 @@ postdeps=""
 
 # The library search path used internally by the compiler when linking
 # a shared library.
-compiler_lib_search_path=""
+compiler_lib_search_path=`echo "" | $SED -e "s@${gcc_dir}@\${gcc_dir}@g;s@${gcc_ver}@\${gcc_ver}@g"`
 
 # Method to check whether dependent libraries are shared objects.
 deplibs_check_method="pass_all"
@@ -7346,10 +7355,10 @@ variables_saved_for_relink="PATH LD_LIBRARY_PATH LD_RUN_PATH GCC_EXEC_PREFIX COM
 link_all_deplibs=unknown
 
 # Compile-time system search path for libraries
-sys_lib_search_path_spec=" /usr/lib64/gcc-lib/x86_64-suse-linux/3.3.5/ /usr/lib/gcc/x86_64-suse-linux/3.3.5/ /usr/lib64/gcc-lib/x86_64-suse-linux/3.3.5/../../../../x86_64-suse-linux/lib/x86_64-suse-linux/3.3.5/ /usr/lib64/gcc-lib/x86_64-suse-linux/3.3.5/../../../../x86_64-suse-linux/lib/ /usr/lib64/gcc-lib/x86_64-suse-linux/3.3.5/../../../x86_64-suse-linux/3.3.5/ /usr/lib64/gcc-lib/x86_64-suse-linux/3.3.5/../../../ /lib/x86_64-suse-linux/3.3.5/ /lib/ /usr/lib/x86_64-suse-linux/3.3.5/ /usr/lib/"
+sys_lib_search_path_spec=`echo " /usr/lib/gcc/i386-redhat-linux/3.4.6/ /usr/lib/gcc/i386-redhat-linux/3.4.6/ /usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../i386-redhat-linux/lib/i386-redhat-linux/3.4.6/ /usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../i386-redhat-linux/lib/ /usr/lib/gcc/i386-redhat-linux/3.4.6/../../../i386-redhat-linux/3.4.6/ /usr/lib/gcc/i386-redhat-linux/3.4.6/../../../ /lib/i386-redhat-linux/3.4.6/ /lib/ /usr/lib/i386-redhat-linux/3.4.6/ /usr/lib/" | $SED -e "s@${gcc_dir}@\${gcc_dir}@g;s@${gcc_ver}@\${gcc_ver}@g"`
 
 # Run-time system search path for libraries
-sys_lib_dlsearch_path_spec="/lib /usr/lib /usr/X11R6/lib64/Xaw3d /usr/X11R6/lib64 /usr/X11R6/lib/Xaw3d /usr/X11R6/lib /usr/x86_64-suse-linux/lib /usr/local/lib64 /usr/local/lib /opt/kde3/lib64 /opt/kde3/lib /opt/gnome/lib64 /opt/gnome/lib /lib64 /lib /usr/lib64 /usr/lib /opt/cluster/intel/cce/9.1.042/lib /opt/cluster/intel/fce/9.1.036/lib /opt/cluster/Pathscale3.0/lib/2.9.99 /opt/cluster/Pathscale3.0/lib/2.9.99/32 /work/licsoft/compilers/pgi/linux86-64/6.2/lib /work/licsoft/compilers/pgi/linux86-64/6.2/libso "
+sys_lib_dlsearch_path_spec="/lib /usr/lib /usr/lib/octave-2.9.9 /usr/lib/qt-3.3/lib /usr/lib/qt4/lib "
 
 # Fix the shell variable $srcfile for the compiler.
 fix_srcfile_path=""
diff --git a/AMDiS/src/CoarseningManager3d.cc b/AMDiS/src/CoarseningManager3d.cc
index 530387d695665f9ced9dc9c51f1d2efbece76822..f16badb0a8c527aad6cf5de971fb0f9ba0c73949 100644
--- a/AMDiS/src/CoarseningManager3d.cc
+++ b/AMDiS/src/CoarseningManager3d.cc
@@ -60,7 +60,7 @@ namespace AMDiS {
     n_neigh = 1;
 
     coarsenList->setOppVertex(0,0,0);
-    coarsenList->setElType(0, (dynamic_cast<ElInfo3d*>( el_info)->getType()));
+    coarsenList->setElType(0, el_info->getType());
     bound = false;
     if (getCoarsenPatch(elinfo, edge, 0, coarsenList, &n_neigh)) {
       getCoarsenPatch(elinfo, edge, 1, coarsenList, &n_neigh);
@@ -220,9 +220,9 @@ namespace AMDiS {
 					  {0,2},
 					  {0,1}};
 
-    el = dynamic_cast<Tetrahedron*>(const_cast<Element*>( el_info->getElement()));
-
-    if ((neigh = dynamic_cast<Tetrahedron*>(const_cast<Element*>( el_info->getNeighbour(3-dir)))) == NULL)  
+    el = dynamic_cast<Tetrahedron*>(const_cast<Element*>(el_info->getElement()));
+    neigh = dynamic_cast<Tetrahedron*>(const_cast<Element*>(el_info->getNeighbour(3 - dir)));
+    if (neigh == NULL)
       return true;
 
     opp_v = el_info->getOppVertex(3-dir);
@@ -237,7 +237,7 @@ namespace AMDiS {
     /****************************************************************************/
     coarsenList->setOppVertex(*n_neigh, 0, opp_v);  
     coarsenList->setElement(*n_neigh, neigh);
-    coarsenList->setElType(*n_neigh, (dynamic_cast<ElInfo3d*>( neigh_info))->getType()); 
+    coarsenList->setElType(*n_neigh, neigh_info->getType()); 
   
     int n_vertices = mesh->getGeo(VERTEX);
 			 
@@ -273,7 +273,8 @@ namespace AMDiS {
       ++*n_neigh;
 
       opp_v = neigh_info->getOppVertex(i);
-      if ((neigh = dynamic_cast<Tetrahedron*>(const_cast<Element*>( neigh_info->getNeighbour(i))))) {
+      neigh = dynamic_cast<Tetrahedron*>(const_cast<Element*>(neigh_info->getNeighbour(i)));
+      if (neigh) {
 	neigh_info = stack->traverseNeighbour3d(neigh_info, i);
 	TEST_EXIT_DBG(neigh == neigh_info->getElement())
 	  ("neigh %d and neigh_info->el %d are not identical\n", 
@@ -284,9 +285,10 @@ namespace AMDiS {
 	/****************************************************************************/
 	coarsenList->setOppVertex(*n_neigh, 0, opp_v);  
 	coarsenList->setElement(*n_neigh, neigh);
-	coarsenList->setElType(*n_neigh, (dynamic_cast<ElInfo3d*>( neigh_info))->getType());
-      } else
+	coarsenList->setElType(*n_neigh, neigh_info->getType());
+      } else {
 	break;
+      }
     }
 
     if (neigh == el)  
diff --git a/AMDiS/src/DataCollector.cc b/AMDiS/src/DataCollector.cc
index 4e02354294b7ccd8ec54f728631194ae76d07c69..72e965f6cacfa37055a8003433a10c7fa38f3ad5 100644
--- a/AMDiS/src/DataCollector.cc
+++ b/AMDiS/src/DataCollector.cc
@@ -266,7 +266,7 @@ namespace AMDiS {
     }
     
     if (dim == 3)
-      elementInfo.type = (dynamic_cast<ElInfo3d*>(elInfo)->getType());
+      elementInfo.type = elInfo->getType();
 
     // remember element info
     elements.push_back(elementInfo);
diff --git a/AMDiS/src/ElInfo.cc b/AMDiS/src/ElInfo.cc
index 7e7e529f3d2500698a5f836c7ecba8ee3c9e4821..6a7680a152b861d074a12c816c0eeaef7c3a5b3a 100644
--- a/AMDiS/src/ElInfo.cc
+++ b/AMDiS/src/ElInfo.cc
@@ -20,13 +20,14 @@ namespace AMDiS {
       parent_(NULL),
       macroElement_(NULL),
       level(0),
+      elType(0),
       iChild(0),
       coord_(mesh_->getDim(), NO_INIT),
       boundary_(mesh_->getDim(), DEFAULT_VALUE, INTERIOR),
       projection_(mesh_->getDim(), NO_INIT),
       oppCoord_(mesh_->getDim(), NO_INIT),
       neighbour_(mesh_->getDim(), NO_INIT),
-      neighbourCoord_(mesh_->getDim(), NO_INIT),
+      neighbourCoord(mesh_->getDim(), NO_INIT),
       oppVertex(mesh_->getDim(), NO_INIT),
       grdLambda(mesh_->getDim(), NO_INIT),
       refinementPath(0),
@@ -34,8 +35,8 @@ namespace AMDiS {
   {
     projection_.set(NULL);
 
-    for (int i = 0; i < neighbourCoord_.getSize(); i++)
-      neighbourCoord_[i].init(mesh_->getDim());
+    for (int i = 0; i < neighbourCoord.getSize(); i++)
+      neighbourCoord[i].init(mesh_->getDim());
 
     dimOfWorld = Global::getGeo(WORLD);
   }
diff --git a/AMDiS/src/ElInfo.h b/AMDiS/src/ElInfo.h
index fe265d6e34cc382207eee3e0a3c3a120d3a55d37..171ba40f0a4644fb21d954984f3fa59a6f9f5db3 100644
--- a/AMDiS/src/ElInfo.h
+++ b/AMDiS/src/ElInfo.h
@@ -77,7 +77,7 @@ namespace AMDiS {
       boundary_ = rhs.boundary_;
       oppCoord_ = rhs.oppCoord_;
       neighbour_ = rhs.neighbour_;
-      neighbourCoord_ = rhs.neighbourCoord_;
+      neighbourCoord = rhs.neighbourCoord;
       oppVertex = rhs.oppVertex;
       return *this;
     }
@@ -186,10 +186,10 @@ namespace AMDiS {
       return neighbour_[i]; 
     }
 
-    /// Get ElInfo's \ref neighbourCoord_[i]
+    /// Get ElInfo's \ref neighbourCoord[i]
     inline FixVec<WorldVector<double>, VERTEX> getNeighbourCoord(int i) const 
     {
-      return neighbourCoord_[i];
+      return neighbourCoord[i];
     }
 
     /// Get ElInfo's \ref oppVertex[i] 
@@ -323,6 +323,12 @@ namespace AMDiS {
       refinementPathLength = length;
     }
 
+    /// Set ElInfo's \ref elType.
+    inline void setType(int t) 
+    { 
+      elType = t; 
+    }
+
     /** \} */
 
 
@@ -408,6 +414,12 @@ namespace AMDiS {
       return(0.0);
     }
 
+    /// Get ElInfo's \ref elType.
+    inline int getType() const 
+    { 
+      return elType; 
+    }
+
   protected:
     /// Pointer to the current mesh
     Mesh *mesh_;
@@ -437,6 +449,13 @@ namespace AMDiS {
      */
     unsigned char level;
 
+    /** \brief
+     * Elements type index. This is used only for 3d, where type can be either 0, 1 or
+     * 2. In all other cases type is not used and the variable is set to 0.
+     * In 3d, it is filled automatically by the traversal routines.
+     */
+    int elType;
+
     /** \brief
      * This ElInfo is the iChild-th child of the parent element.
      */
@@ -475,10 +494,10 @@ namespace AMDiS {
     FixVec<Element*, NEIGH> neighbour_;
 
     /** \brief
-     * neighbourCoord_[i][j] are the coordinate of the j-th vertex of the i-th
+     * neighbourCoord[i][j] are the coordinate of the j-th vertex of the i-th
      * neighbour element with the common edge/face.
      */
-    FixVec<FixVec<WorldVector<double>, VERTEX>, NEIGH> neighbourCoord_;
+    FixVec<FixVec<WorldVector<double>, VERTEX>, NEIGH> neighbourCoord;
 
     /** \brief 
      * oppVertex[i] is undefined if neighbour_[i] is a pointer to NULL. 
diff --git a/AMDiS/src/ElInfo2d.cc b/AMDiS/src/ElInfo2d.cc
index 11815d94fde0644957bd05551e73c6bd3641eec1..7f8f209f7b77f842202340a0b9e422768c5bf522 100644
--- a/AMDiS/src/ElInfo2d.cc
+++ b/AMDiS/src/ElInfo2d.cc
@@ -146,45 +146,45 @@ namespace AMDiS {
 
 		switch (edgeNo) {
 		case 1:
-		  neighbourCoord_[i][0] = macroNeighbour->coord[2];
-		  neighbourCoord_[i][1] = macroNeighbour->coord[0];
+		  neighbourCoord[i][0] = macroNeighbour->coord[2];
+		  neighbourCoord[i][1] = macroNeighbour->coord[0];
 		  break;
 		case 0:		  
-		  neighbourCoord_[i][0] = macroNeighbour->coord[1];
-		  neighbourCoord_[i][1] = macroNeighbour->coord[2];
+		  neighbourCoord[i][0] = macroNeighbour->coord[1];
+		  neighbourCoord[i][1] = macroNeighbour->coord[2];
 		  break;
 		default:
 		  ERROR_EXIT("Should not happen!\n");
 		}
 	
-		neighbourCoord_[i][2] = oppCoord_[i];
+		neighbourCoord[i][2] = oppCoord_[i];
 		break;
 		
 	      case 1:
 		// The commonedge is the edge 1 of this element.
 		switch (edgeNo) {
 		case 0:
-		  neighbourCoord_[i][0] = macroNeighbour->coord[1];
-		  neighbourCoord_[i][1] = macroNeighbour->coord[2];
+		  neighbourCoord[i][0] = macroNeighbour->coord[1];
+		  neighbourCoord[i][1] = macroNeighbour->coord[2];
 		  break;
 		case 1:
-		  neighbourCoord_[i][0] = macroNeighbour->coord[2];
-		  neighbourCoord_[i][1] = macroNeighbour->coord[0];
+		  neighbourCoord[i][0] = macroNeighbour->coord[2];
+		  neighbourCoord[i][1] = macroNeighbour->coord[0];
 		  break;
 		default:
 		  ERROR_EXIT("Should not happen!\n");
 		}
 		
-		neighbourCoord_[i][2] = oppCoord_[i];
+		neighbourCoord[i][2] = oppCoord_[i];
 		break;
 		
 	      case 2:
 		if (*(macroNeighbour->getElement()->getDOF(2)) == *(element_->getDOF(0))) {
-		  neighbourCoord_[i][0] = macroNeighbour->coord[2];
-		  neighbourCoord_[i][1] = macroNeighbour->coord[1];
+		  neighbourCoord[i][0] = macroNeighbour->coord[2];
+		  neighbourCoord[i][1] = macroNeighbour->coord[1];
 		} else if (*(macroNeighbour->getElement()->getDOF(2)) == *(element_->getDOF(1))) {
-		  neighbourCoord_[i][0] = macroNeighbour->coord[0];
-		  neighbourCoord_[i][1] = macroNeighbour->coord[2];		 
+		  neighbourCoord[i][0] = macroNeighbour->coord[0];
+		  neighbourCoord[i][1] = macroNeighbour->coord[2];		 
 		} else {
 		  ERROR_EXIT("Should not happen!\n");
 		}
@@ -226,7 +226,7 @@ namespace AMDiS {
 
 	    if (fill_opp_coords) {
 	      oppCoord_[i] = macroNeighbour->coord[edgeNo];
-	      neighbourCoord_[i] = macroNeighbour->coord;	      
+	      neighbourCoord[i] = macroNeighbour->coord;	      
 	    }
 	  }
 	} else {
@@ -302,7 +302,7 @@ namespace AMDiS {
 	
 	if (neighbour_[2] && fill_opp_coords) {
 	  oppCoord_[2] = elInfoOld->oppCoord_[1];
-	  neighbourCoord_[2] = elInfoOld->neighbourCoord_[1];
+	  neighbourCoord[2] = elInfoOld->neighbourCoord[1];
 	}
 	
 	
@@ -324,9 +324,9 @@ namespace AMDiS {
 				       elInfoOld->coord_[2]);
 	    }
 
-	    neighbourCoord_[1][0] = coord_[0];
-	    neighbourCoord_[1][1] = coord_[2];
-	    neighbourCoord_[1][2] = oppCoord_[1];  
+	    neighbourCoord[1][0] = coord_[0];
+	    neighbourCoord[1][1] = coord_[2];
+	    neighbourCoord[1][2] = oppCoord_[1];  
 	  }
 	} else {
 	  neighbour_[1] = elem->getSecondChild();
@@ -335,9 +335,9 @@ namespace AMDiS {
 	  if (fill_opp_coords) {
 	    oppCoord_[1] = elInfoOld->coord_[1];
 
-	    neighbourCoord_[1][0] = elInfoOld->coord_[1];
-	    neighbourCoord_[1][1] = elInfoOld->coord_[2];
-	    neighbourCoord_[1][2] = coord_[2];
+	    neighbourCoord[1][0] = elInfoOld->coord_[1];
+	    neighbourCoord[1][1] = elInfoOld->coord_[2];
+	    neighbourCoord[1][2] = coord_[2];
 	  }
 	}
 
@@ -360,14 +360,14 @@ namespace AMDiS {
 	      if (nb->isNewCoordSet()) {
 		oppCoord_[0] = *(nb->getNewCoord());
 	      } else {
-		oppCoord_[0].setMidpoint(elInfoOld->neighbourCoord_[2][1],
-					 elInfoOld->neighbourCoord_[2][2]);
+		oppCoord_[0].setMidpoint(elInfoOld->neighbourCoord[2][1],
+					 elInfoOld->neighbourCoord[2][2]);
 	      }
 
-	      neighbourCoord_[0][0].setMidpoint(elInfoOld->neighbourCoord_[2][0],
-						elInfoOld->neighbourCoord_[2][1]);
-	      neighbourCoord_[0][1] = elInfoOld->neighbourCoord_[2][1];
-	      neighbourCoord_[0][2] = oppCoord_[0];
+	      neighbourCoord[0][0].setMidpoint(elInfoOld->neighbourCoord[2][0],
+						elInfoOld->neighbourCoord[2][1]);
+	      neighbourCoord[0][1] = elInfoOld->neighbourCoord[2][1];
+	      neighbourCoord[0][2] = oppCoord_[0];
 	    }	   
  
 	    nb = nb->getFirstChild();
@@ -377,10 +377,10 @@ namespace AMDiS {
 	    if (fill_opp_coords) {
 	      oppCoord_[0] = elInfoOld->oppCoord_[2];    
 
-	      neighbourCoord_[0][0] = elInfoOld->neighbourCoord_[2][0];
-	      neighbourCoord_[0][1] = elInfoOld->neighbourCoord_[2][2];
-	      neighbourCoord_[0][2].setMidpoint(elInfoOld->neighbourCoord_[2][0],
-						elInfoOld->neighbourCoord_[2][1]);
+	      neighbourCoord[0][0] = elInfoOld->neighbourCoord[2][0];
+	      neighbourCoord[0][1] = elInfoOld->neighbourCoord[2][2];
+	      neighbourCoord[0][2].setMidpoint(elInfoOld->neighbourCoord[2][0],
+						elInfoOld->neighbourCoord[2][1]);
 	    }
 	  }
 	}
@@ -395,7 +395,7 @@ namespace AMDiS {
 
 	if (neighbour_[2] && fill_opp_coords) {
 	  oppCoord_[2] = elInfoOld->oppCoord_[0];
-	  neighbourCoord_[2] = elInfoOld->neighbourCoord_[0];
+	  neighbourCoord[2] = elInfoOld->neighbourCoord[0];
 	}
 	
 
@@ -414,9 +414,9 @@ namespace AMDiS {
 				       elInfoOld->coord_[2]);
 	    }
 
-	    neighbourCoord_[0][0] = coord_[2];
-	    neighbourCoord_[0][1] = coord_[1];
-	    neighbourCoord_[0][2] = oppCoord_[0];
+	    neighbourCoord[0][0] = coord_[2];
+	    neighbourCoord[0][1] = coord_[1];
+	    neighbourCoord[0][2] = oppCoord_[0];
 	  }
 	} else {
 	  neighbour_[0] = elem->getFirstChild();
@@ -425,9 +425,9 @@ namespace AMDiS {
 	  if (fill_opp_coords) {
 	    oppCoord_[0] = elInfoOld->coord_[0];
 
-	    neighbourCoord_[0][0] = elInfoOld->coord_[2];
-	    neighbourCoord_[0][1] = elInfoOld->coord_[0];
-	    neighbourCoord_[0][2] = coord_[2];
+	    neighbourCoord[0][0] = elInfoOld->coord_[2];
+	    neighbourCoord[0][1] = elInfoOld->coord_[0];
+	    neighbourCoord[0][2] = coord_[2];
 	  }
 	}
 
@@ -446,14 +446,14 @@ namespace AMDiS {
 	      if (nb->isNewCoordSet()) {
 		oppCoord_[1] = *(nb->getNewCoord());
 	      } else {
-		oppCoord_[1].setMidpoint(elInfoOld->neighbourCoord_[2][0],
-					 elInfoOld->neighbourCoord_[2][2]);
+		oppCoord_[1].setMidpoint(elInfoOld->neighbourCoord[2][0],
+					 elInfoOld->neighbourCoord[2][2]);
 	      }
 
-	      neighbourCoord_[1][0] = elInfoOld->neighbourCoord_[2][0];
-	      neighbourCoord_[1][1].setMidpoint(elInfoOld->neighbourCoord_[2][0],
-						elInfoOld->neighbourCoord_[2][1]);
-	      neighbourCoord_[1][2] = oppCoord_[1];
+	      neighbourCoord[1][0] = elInfoOld->neighbourCoord[2][0];
+	      neighbourCoord[1][1].setMidpoint(elInfoOld->neighbourCoord[2][0],
+					       elInfoOld->neighbourCoord[2][1]);
+	      neighbourCoord[1][2] = oppCoord_[1];
 	    }
 	    nb = nb->getSecondChild();
 
@@ -463,10 +463,10 @@ namespace AMDiS {
 	    if (fill_opp_coords) {
 	      oppCoord_[1] = elInfoOld->oppCoord_[2];
 
-	      neighbourCoord_[1][0] = elInfoOld->neighbourCoord_[2][2];	      
-	      neighbourCoord_[1][1] = elInfoOld->neighbourCoord_[2][0];
-	      neighbourCoord_[1][2].setMidpoint(elInfoOld->neighbourCoord_[2][0],
-						elInfoOld->neighbourCoord_[2][1]);
+	      neighbourCoord[1][0] = elInfoOld->neighbourCoord[2][2];	      
+	      neighbourCoord[1][1] = elInfoOld->neighbourCoord[2][0];
+	      neighbourCoord[1][2].setMidpoint(elInfoOld->neighbourCoord[2][0],
+					       elInfoOld->neighbourCoord[2][1]);
 	    }
 	  }
 	}
diff --git a/AMDiS/src/ElInfo3d.cc b/AMDiS/src/ElInfo3d.cc
index 43a00c6dc0665006025990e5ca5616698fb05a42..948f775b0b94b5ba2b506c181cb3f54e8ba87e9a 100644
--- a/AMDiS/src/ElInfo3d.cc
+++ b/AMDiS/src/ElInfo3d.cc
@@ -25,7 +25,7 @@ namespace AMDiS {
     element_  = const_cast<Element*>( mel->getElement());
     parent_ = NULL;
     level = 0;
-    el_type = const_cast<MacroElement*>(mel)->getElType();
+    elType = const_cast<MacroElement*>(mel)->getElType();
 
     int vertices = mesh_->getGeo(VERTEX);
 
@@ -369,7 +369,7 @@ namespace AMDiS {
     level = elInfoOld->level + 1;
     iChild = ichild;
     int el_type_local = (dynamic_cast<const ElInfo3d*>(elInfoOld))->getType();
-    el_type = (el_type_local + 1) % 3;
+    elType = (el_type_local + 1) % 3;
 
     TEST_EXIT_DBG(element_)("missing child %d?\n", ichild);
 
diff --git a/AMDiS/src/ElInfo3d.h b/AMDiS/src/ElInfo3d.h
index 1e219b789d021f8286674f188562ad58ad6c704f..50ae715420ed2c6b00a72dadbac174aec9fabdca 100644
--- a/AMDiS/src/ElInfo3d.h
+++ b/AMDiS/src/ElInfo3d.h
@@ -45,7 +45,7 @@ namespace AMDiS {
     ElInfo3d& operator=(const ElInfo3d& rhs) 
     {
       ElInfo::operator=(rhs);
-      el_type = rhs.el_type;
+      elType = rhs.elType;
       orientation = rhs.orientation;
       return *this;
     } 
@@ -68,24 +68,12 @@ namespace AMDiS {
     /// update ElInfo after refinement (of some neighbours). Only in 3d!
     void update();
 
-    /// get ElInfo's \ref el_type
-    inline unsigned char getType() const 
-    { 
-      return el_type; 
-    }
-
     /// get ElInfo's \ref orientation
     inline signed char getOrientation() const 
     { 
       return orientation; 
     }
 
-    /// set ElInfo's \ref el_type to t
-    inline void setType(unsigned char t) 
-    { 
-      el_type = t; 
-    }
-
     /// set ElInfo's \ref orientation to o
     inline void setOrientation(signed char o) 
     { 
@@ -93,9 +81,6 @@ namespace AMDiS {
     }
 
   protected:
-    /// \ref el 's type. Is Filled automatically by the traversal routines.
-    unsigned char el_type;
-
     /** \brief
      * +/- 1: sign of the determinant of the transformation to the reference
      * element with vertices (0,0,0), (1,1,1), (1,1,0), (1,0,0).
diff --git a/AMDiS/src/MacroReader.cc b/AMDiS/src/MacroReader.cc
index 8aedf92eef3b13b1aef6e95d92557320bbb973f1..9294f5bd334caace95a38b303f408acdc68e0809 100644
--- a/AMDiS/src/MacroReader.cc
+++ b/AMDiS/src/MacroReader.cc
@@ -995,15 +995,13 @@ namespace AMDiS {
 	    std::cout << "  coords of element = ";
 	    for (int l = 0; l <= dim; l++) {
 	      std::cout << mesh->getMacroElement(i)->getCoord(l);
-	      if (l < dim) {
-		std::cout << " / ";
-	      }
+	      if (l < dim)
+		std::cout << " / ";	      
 	    }
 	    std::cout << std::endl;
 	    std::cout << "  dofs = ";
-	    for (int l = 0; l < dim; l++) {
-	      std::cout << *(dof[l]) << " ";
-	    }
+	    for (int l = 0; l < dim; l++)
+	      std::cout << *(dof[l]) << " ";	    
 	    std::cout << std::endl;
 
 	    ERROR_EXIT("\n");
diff --git a/AMDiS/src/RefinementManager3d.cc b/AMDiS/src/RefinementManager3d.cc
index e2cfa322cf9ed75374af8a887631920757b59572..487ce5952644f2f12da00bcfebe4c4e4932d3c05 100644
--- a/AMDiS/src/RefinementManager3d.cc
+++ b/AMDiS/src/RefinementManager3d.cc
@@ -21,7 +21,9 @@ namespace AMDiS {
 					      DegreeOfFreedom* dof[3],
 					      DegreeOfFreedom *edge[2])
   {
-    Tetrahedron *el = dynamic_cast<Tetrahedron*>(const_cast<Element*>( ref_list->getElement(index))), *child[2];
+    Tetrahedron *el = 
+      dynamic_cast<Tetrahedron*>(const_cast<Element*>(ref_list->getElement(index)));
+    Tetrahedron *child[2];
     int i, node;
     int el_type = ref_list->getType(index);
 
@@ -50,9 +52,9 @@ namespace AMDiS {
 
     for (i = 0; i < n_vertices-1; i++) {
       child[0]->
-	setDOF(i, const_cast<int*>( el->getDOF(Tetrahedron::childVertex[el_type][0][i])));
+	setDOF(i, const_cast<int*>(el->getDOF(Tetrahedron::childVertex[el_type][0][i])));
       child[1]->
-	setDOF(i, const_cast<int*>( el->getDOF(Tetrahedron::childVertex[el_type][1][i])));
+	setDOF(i, const_cast<int*>(el->getDOF(Tetrahedron::childVertex[el_type][1][i])));
     }
     /****************************************************************************/
     /*  there is one more leaf element and two more hierachical elements        */
@@ -75,33 +77,33 @@ namespace AMDiS {
       
       child[0]->
 	setDOF(node, 
-	       const_cast<int*>( el->getDOF(node+Tetrahedron::childEdge[el_type][0][0])));
+	       const_cast<int*>(el->getDOF(node+Tetrahedron::childEdge[el_type][0][0])));
       child[1]->
 	setDOF(node, 
-	       const_cast<int*>( el->getDOF(node+Tetrahedron::childEdge[el_type][1][0])));
+	       const_cast<int*>(el->getDOF(node+Tetrahedron::childEdge[el_type][1][0])));
       child[0]->
-	setDOF(node+1, 
-	       const_cast<int*>( el->getDOF(node+Tetrahedron::childEdge[el_type][0][1])));
+	setDOF(node + 1, 
+	       const_cast<int*>(el->getDOF(node+Tetrahedron::childEdge[el_type][0][1])));
       child[1]->
-	setDOF(node+1, 
-	       const_cast<int*>( el->getDOF(node+Tetrahedron::childEdge[el_type][1][1])));
+	setDOF(node + 1, 
+	       const_cast<int*>(el->getDOF(node+Tetrahedron::childEdge[el_type][1][1])));
       child[0]->
-	setDOF(node+3, 
-	       const_cast<int*>( el->getDOF(node+Tetrahedron::childEdge[el_type][0][3])));
+	setDOF(node + 3, 
+	       const_cast<int*>(el->getDOF(node+Tetrahedron::childEdge[el_type][0][3])));
       child[1]->
-	setDOF(node+3, 
-	       const_cast<int*>( el->getDOF(node+Tetrahedron::childEdge[el_type][1][3])));
+	setDOF(node + 3, 
+	       const_cast<int*>(el->getDOF(node+Tetrahedron::childEdge[el_type][1][3])));
       
       /****************************************************************************/
       /*  adjust pointers to the dof's in the refinement edge                     */
       /****************************************************************************/
       
       if (el->getDOF(0) == edge[0]) {
-	child[0]->setDOF(node+2, dof[1]);
-	child[1]->setDOF(node+2, dof[2]);
+	child[0]->setDOF(node + 2, dof[1]);
+	child[1]->setDOF(node + 2, dof[2]);
       } else {
-	child[0]->setDOF(node+2, dof[2]);
-	child[1]->setDOF(node+2, dof[1]);
+	child[0]->setDOF(node + 2, dof[2]);
+	child[1]->setDOF(node + 2, dof[1]);
       }
     }
     
@@ -139,18 +141,19 @@ namespace AMDiS {
   {
     FUNCNAME("RefinementManager3d::fillPatchConnectivity");
     Element *el = ref_list->getElement(index), *neigh;
-    int     dir, el_type = ref_list->getType(index), n_type = 0;
-    int     adjc, i, j, i_neigh, j_neigh;
-    int     node0, node1, opp_v = 0;
+    int el_type = ref_list->getType(index);
+    int n_type = 0;
+    int dir, adjc, i, j, i_neigh, j_neigh;
+    int node0, node1, opp_v = 0;
 
     for (dir = 0; dir < 2; dir++) {
       neigh = ref_list->getNeighbourElement(index, dir);
       if (neigh) {
-	n_type = ref_list->getType( ref_list->getNeighbourNr(index, dir) );
+	n_type = ref_list->getType(ref_list->getNeighbourNr(index, dir));
 	opp_v = ref_list->getOppVertex(index, dir);
       }
 
-      if (!neigh  ||  neigh->isLeaf()) {
+      if (!neigh || neigh->isLeaf()) {
 
 	/****************************************************************************/
 	/*  get new dof's in the midedge of the face of el and for the two midpoints*/
@@ -235,23 +238,19 @@ namespace AMDiS {
   int RefinementManager3d::newCoordsFct(ElInfo *el_info)
   {
     Element *el = el_info->getElement();
-    int i, j, n_neigh;
     DegreeOfFreedom *edge[2];
-    ElInfo *elinfo =  el_info;
-
+    ElInfo *elinfo = el_info;
     int dow = Global::getGeo(WORLD);
-
     Projection *projector = el_info->getProjection(0);
 
-    if (!projector || projector->getType() != VOLUME_PROJECTION) {
-      projector = el_info->getProjection(4);
-    }
+    if (!projector || projector->getType() != VOLUME_PROJECTION)
+      projector = el_info->getProjection(4);    
 
     if (el->getFirstChild() && projector && (!el->isNewCoordSet())) {
       WorldVector<double> *new_coord = new WorldVector<double>;
 
-      for (j = 0; j < dow; j++)
-	(*new_coord)[j] = (el_info->getCoord(0)[j] + el_info->getCoord(1)[j])*0.5;
+      for (int j = 0; j < dow; j++)
+	(*new_coord)[j] = (el_info->getCoord(0)[j] + el_info->getCoord(1)[j]) * 0.5;
 
       projector->project(*new_coord);
 
@@ -261,11 +260,11 @@ namespace AMDiS {
       /*  get the refinement patch                                                */
       /****************************************************************************/
       refList->setElement(0, el);
-      refList->setElType(0, dynamic_cast<ElInfo3d*>(el_info)->getType());
-      n_neigh = 1;
+      refList->setElType(0, el_info->getType());
+      int n_neigh = 1;
 
-      for (i = 0; i < 2; i++)
-	edge[i] = const_cast<int*>( el_info->getElement()->getDOF(i));
+      for (int i = 0; i < 2; i++)
+	edge[i] = const_cast<int*>(el_info->getElement()->getDOF(i));
 
       if (getRefinePatch(&elinfo, edge, 0, refList, &n_neigh)) {
 	/****************************************************************************/
@@ -274,7 +273,7 @@ namespace AMDiS {
 	getRefinePatch(&elinfo, edge, 1, refList, &n_neigh);
       }
 
-      for (i = 1; i < n_neigh; i++) {            /* start with 1, as list[0]=el */
+      for (int i = 1; i < n_neigh; i++) {            /* start with 1, as list[0]=el */
 	TEST(!refList->getElement(i)->isNewCoordSet())
 	  ("non-nil new_coord in el %d ref_list[%d] el %d (n_neigh=%d)\n",
 	   el->getIndex(), i, refList->getElement(i)->getIndex(), n_neigh);
@@ -392,22 +391,22 @@ namespace AMDiS {
 					  RCNeighbourList* refineList, 
 					  int *n_neigh)
   {
-    FUNCNAME("RefinementManager3d::getRefinePatch");
-    ElInfo *neigh_info;
+    FUNCNAME("RefinementManager3d::getRefinePatch()");
 
-    Tetrahedron *el, *neigh;
-    int          i, j, k, opp_v = 0;
-    int          edge_no, neigh_el_type;
+    int i, j, k;
 
-    el = dynamic_cast<Tetrahedron*>(const_cast<Element*>( (*el_info)->getElement()));
-  
-    if ((*el_info)->getNeighbour(3-dir) == NULL)  {return(1);}
+    Tetrahedron *el = 
+      dynamic_cast<Tetrahedron*>(const_cast<Element*>((*el_info)->getElement()));
+    
+    if ((*el_info)->getNeighbour(3 - dir) == NULL)
+      return 1;
   
-    opp_v = (*el_info)->getOppVertex(3-dir);
-    neigh_info = stack->traverseNeighbour3d((*el_info), 3-dir);
-    neigh_el_type = dynamic_cast<ElInfo3d*>(neigh_info)->getType();
+    int opp_v = (*el_info)->getOppVertex(3-dir);
+    ElInfo *neigh_info = stack->traverseNeighbour3d((*el_info), 3 - dir);
+    int neigh_el_type = neigh_info->getType();
 
-    neigh = dynamic_cast<Tetrahedron*>(const_cast<Element*>( neigh_info->getElement()));
+    Tetrahedron *neigh = 
+      dynamic_cast<Tetrahedron*>(const_cast<Element*>( neigh_info->getElement()));
   
     int vertices = mesh->getGeo(VERTEX);
 
@@ -474,7 +473,8 @@ namespace AMDiS {
 	 edge[0][0], edge[1][0], neigh->getIndex(), neigh->getDOF(0,0),
 	 neigh->getDOF(1,0), neigh->getDOF(2,0), neigh->getDOF(3,0));
 
-      if ((edge_no = Tetrahedron::edgeOfDOFs[j][k])) {
+      int edge_no = Tetrahedron::edgeOfDOFs[j][k];
+      if (edge_no) {
 	/****************************************************************************/
 	/*  neigh has not a compatible refinement edge                              */
 	/****************************************************************************/
@@ -487,7 +487,7 @@ namespace AMDiS {
 	/****************************************************************************/
 	
 	neigh_info = stack->traverseNext(neigh_info);
-	neigh_el_type = dynamic_cast<ElInfo3d*>(neigh_info)->getType();
+	neigh_el_type = neigh_info->getType();
 	
 	switch (edge_no) {
 	case 1: 
@@ -498,7 +498,7 @@ namespace AMDiS {
 	  break;
 	case 3: 
 	  neigh_info = stack->traverseNext(neigh_info);
-	  neigh_el_type = dynamic_cast<ElInfo3d*>(neigh_info)->getType();
+	  neigh_el_type = neigh_info->getType();
 	  if (neigh_el_type != 1)
 	    opp_v = opp_v == 0 ? 3 : 2;
 	  else
@@ -506,7 +506,7 @@ namespace AMDiS {
 	  break;
 	case 4:
 	  neigh_info = stack->traverseNext(neigh_info);
-	  neigh_el_type = dynamic_cast<ElInfo3d*>(neigh_info)->getType();
+	  neigh_el_type = neigh_info->getType();
 	  if (neigh_el_type != 1)
 	    opp_v = opp_v == 0 ? 3 : 1;
 	  else
@@ -515,12 +515,13 @@ namespace AMDiS {
 	case 5:
 	  if (neigh_el_type != 1) {
 	    neigh_info = stack->traverseNext(neigh_info);
-	    neigh_el_type = (dynamic_cast<ElInfo3d*>(neigh_info))->getType();
+	    neigh_el_type = neigh_info->getType();
 	  }
 	  opp_v = 3;
 	  break;
 	}
-	neigh = dynamic_cast<Tetrahedron*>(const_cast<Element*>( neigh_info->getElement()));
+	neigh = 
+	  dynamic_cast<Tetrahedron*>(const_cast<Element*>(neigh_info->getElement()));
       } else {
 	/****************************************************************************/
 	/*  neigh is compatible devisible; put neigh to the list of patch elements; */
@@ -549,8 +550,9 @@ namespace AMDiS {
 	if (neigh_info->getNeighbour(i)) {
 	  opp_v = neigh_info->getOppVertex(i);
 	  neigh_info = stack->traverseNeighbour3d(neigh_info, i);
-	  neigh_el_type = (dynamic_cast<ElInfo3d*>(neigh_info))->getType();
-	  neigh = dynamic_cast<Tetrahedron*>(const_cast<Element*>( neigh_info->getElement()));
+	  neigh_el_type = neigh_info->getType();
+	  neigh = 
+	    dynamic_cast<Tetrahedron*>(const_cast<Element*>(neigh_info->getElement()));
 	} else
 	  break;
       }
@@ -558,7 +560,7 @@ namespace AMDiS {
     
     if (neigh == el) {
       (*el_info) = neigh_info;
-      return(0);
+      return 0;
     }
     
     /****************************************************************************/
@@ -582,18 +584,18 @@ namespace AMDiS {
   ElInfo* RefinementManager3d::refineFunction(ElInfo* el_info)
   {
     FUNCNAME("RefinementManager3d::refineFunction()");
-    int              n_neigh, bound = false;
-    DegreeOfFreedom  *edge[2];
-    RCNeighbourList  *ref_list;
+    int n_neigh, bound = false;
+    DegreeOfFreedom *edge[2];
+    RCNeighbourList *ref_list;
 
     if (el_info->getElement()->getMark() <= 0)  
-      return(el_info);    /*   element may not be refined   */
+      return el_info;    /*   element may not be refined   */
 
     /****************************************************************************/
     /*  get memory for a list of all elements at the refinement edge            */
     /****************************************************************************/
     ref_list = new RCNeighbourList(mesh->getMaxEdgeNeigh());
-    ref_list->setElType(0, (dynamic_cast<ElInfo3d*>(el_info))->getType());
+    ref_list->setElType(0, el_info->getType());
     ref_list->setElement(0, el_info->getElement());
     n_neigh = 1;
 
diff --git a/AMDiS/src/Tetrahedron.h b/AMDiS/src/Tetrahedron.h
index b645b3bb0a189aff6f88329ba72dbac124369829..d08907b86b83974dd379a6ce7042621aeb608901 100644
--- a/AMDiS/src/Tetrahedron.h
+++ b/AMDiS/src/Tetrahedron.h
@@ -44,7 +44,8 @@ namespace AMDiS {
     {}
 
     /// implements Element::clone
-    inline Element *clone() { 
+    inline Element *clone() 
+    { 
       return new Tetrahedron(mesh); 
     }
 
diff --git a/AMDiS/src/Traverse.cc b/AMDiS/src/Traverse.cc
index d349485db085a84124de4a16a22d4bc348511705..f2d48199749ba4ada2342714e75f7a7b91d00609 100644
--- a/AMDiS/src/Traverse.cc
+++ b/AMDiS/src/Traverse.cc
@@ -492,7 +492,7 @@ namespace AMDiS {
 
     while (stack_used > 1) { /* go up in tree until we can go down again */
       stack_used--;
-      typ = dynamic_cast<ElInfo3d*>( elinfo_stack[stack_used])->getType();
+      typ = elinfo_stack[stack_used]->getType();
       nb = coarse_nb[typ][info_stack[stack_used]][nb];
       if (nb == -1) 
 	break;
@@ -510,20 +510,17 @@ namespace AMDiS {
     opp_vertex = old_elinfo->getOppVertex(neighbour);
 
     if (nb >= 0) {                           /* go to macro element neighbour */
-
       i = traverse_mel->getOppVertex(nb);
       traverse_mel = traverse_mel->getNeighbour(nb);
       if (traverse_mel == NULL)  return(NULL);
     
-      if ((nb < 2) && (save_stack_used > 1)) {
+      if (nb < 2 && save_stack_used > 1)
 	stack2_used = 2;                /* go down one level in OLD hierarchy */
-      }
-      else {
+      else
 	stack2_used = 1;
-      }
+      
       elinfo2 = save_elinfo_stack[stack2_used];
       el2 = elinfo2->getElement();
-
       stack_used = 1;
       elinfo_stack[stack_used]->fillMacroInfo(traverse_mel);
       info_stack[stack_used] = 0;