           {0, 0, 1}, // 0
           {1, 0, 1}, // 1
           {1, 0, 0}, // 2
-          {0, 0, 0}, // 3
-          {0, 1, 1}, // 4
+          {0, 0, 0}, // 3 
+          {0, 1, 1}, // 4 
           {1, 1, 1}, // 5
           {1, 1, 0}, // 6
           {0, 1, 0}, // 7
+        };
+
+       
+
+        unsigned vv[8] = {
+          0b001,  // 0
+          0b101,  // 1
+          0b100,  // 2
+          0b000,  // 3
+          0b011,  // 4
+          0b111,  // 5
+          0b110,  // 6
+          0b010,  // 7
         };
         const unsigned e[12][2] = {
           {0,1}, // 0

  CHECKED_CUDA(cudaMalloc(&deviceMem, scalarField_host.size()));
  CHECKED_CUDA(cudaMemcpy(deviceMem, scalarField_host.data(), scalarField_host.size(), cudaMemcpyHostToDevice));


  // reference code
  fprintf(stderr, "%d %zu\n", nx * ny * nz * 2, scalarField_host.size());
  assert(nx * ny * nz * 4 == scalarField_host.size());
  const float threshold = 100.f;
  std::vector<float> vertices;
  const float* f = reinterpret_cast<const float*>(scalarField_host.data());
  for (unsigned k = 0; k + 1 < nz; k++) {

          vertices.push_back((2 * j + v[e[r][0]][1] + v[e[r][1]][1]) / (2.f * ny));
          vertices.push_back((2 * k + v[e[r][0]][2] + v[e[r][1]][2]) / (2.f * nz));
        }
#endif
      }
    }
  }
