diff --git a/dune/tectonic/data-structures/program_state.hh b/dune/tectonic/data-structures/program_state.hh
index d6a921c2b7a17ab408adcad05c993a741dfdf126..4bc169ece1892c173eca33965861f7fdd3acf246 100644
--- a/dune/tectonic/data-structures/program_state.hh
+++ b/dune/tectonic/data-structures/program_state.hh
@@ -151,17 +151,19 @@ template <class VectorTEMPLATE, class ScalarVectorTEMPLATE> class ProgramState {
     // Assuming dPhi(v = 0) = 0, we thus only have to solve Au = ell0
     BitVector dirichletNodes;
     contactNetwork.totalNodes("dirichlet", dirichletNodes);
-    /*for (size_t i=0; i<dirichletNodes.size(); i++) {
-        bool val = false;
-        for (size_t d=0; d<dims; d++) {
-            val = val || dirichletNodes[i][d];
-        }
 
-        dirichletNodes[i] = val;
-        for (size_t d=0; d<dims; d++) {
-            dirichletNodes[i][d] = val;
+    size_t dof = 0;
+    for (size_t i=0; i<bodyCount_; i++) {
+        const auto& body = *contactNetwork.body(i);
+
+        if (body.data()->getYoungModulus() == 0.0) {
+            for (; dof<body.nVertices(); dof++) {
+                dirichletNodes[dof] = true;
+            }
+        } else {
+            dof += body.nVertices();
         }
-    }*/
+    }
 
     std::cout << "solving linear problem for u..." << std::endl;