diff --git a/examples/dumppmicubed.cc b/examples/dumppmicubed.cc
deleted file mode 100644
index 8c3bf56..0000000
--- a/examples/dumppmicubed.cc
+++ /dev/null
@@ -1,46 +0,0 @@
-#include <typeinfo>
-#include <assert.h>
-#include <memory>
-#include <iostream>
-#include <stdint.h>
-#include "../src/collocatordb.h"
-#include <thread>
-#include <chrono>
-#include <sstream> // for ostringstream
-#include <fstream>
-
-using namespace rocksdb;
-
-  
-int main(int argc, char** argv) {
-  const int START=1;
-  const int STOP=300000;
-  uint32_t *array;
-  int done = 0;
-
-  array = (uint32_t *)malloc(STOP * 20 * sizeof(uint32_t));
-  memset(array, 0, STOP * 20 * sizeof(uint32_t));
-  FILE* pFile;
-  CollocatorDB cdb = CollocatorDB(argv[1], true);
-  std::cerr << "Database " << argv[1] << " opened\n";
-  #pragma omp parallel for schedule(dynamic, 1)
-  for(uint32_t i=START; i< STOP; i++) {
-    std::vector<rocksdb::Collocator> cs = cdb.get_collocators(i, STOP);
-    int j=0;
-    for (rocksdb::Collocator c : cs) {
-      if(c.w2 != i) {
-        array[i*20+j] = (uint32_t) c.w2;
-        if(++j >=20)
-          break;
-      }
-    }
-    if(done++  % 100 == 0) {
-      std::cerr <<"\r\033[2K"<<std::flush;
-      std::cerr << "done: " << done * 100.0 / (STOP-START) << "%" << " (todo: " << STOP-START-done << ")" << std::flush;
-    }
-  }
-  pFile = fopen("file.binary", "wb");
-  fwrite(array, sizeof(uint32_t), STOP*20, pFile);
-  fclose(pFile);
-  std::cout << std::flush;
-}
diff --git a/examples/testcdb.cc b/examples/testcdb.cc
deleted file mode 100644
index 64e9304..0000000
--- a/examples/testcdb.cc
+++ /dev/null
@@ -1,52 +0,0 @@
-#include <typeinfo>
-#include <assert.h>
-#include <memory>
-#include <iostream>
-#include <stdint.h>
-#include "../src/collocatordb.h"
-using namespace rocksdb;
-
-void dumpDb(Collocators& counters) {
-    auto it = std::unique_ptr<CollocatorIterator>(counters.SeekIterator(1000,0,0));
-    for (; it->isValid(); it->Next()) {
-      uint64_t value = it->intValue();
-      uint64_t key = it->intKey();
-      std::cout << "w1:" << W1(key) << ", w2:" << W2(key) << ", dist:" << (int32_t) DIST(key) << " - count:" << value << std::endl;
-    }
-    std::cout << "ready dumping\n";
-  }
-
-  void testCollocators(Collocators& counters) {
-    counters.inc(100,200,5);
-    counters.inc(1000,2000,-5);
-    counters.inc(1000,2000,5);
-    counters.inc(1000,2500,-3);
-    counters.inc(1000,2500,4);
-    counters.inc(1000,2900,3);
-
-    counters.inc(1001,2900,3);
-
-    for(int i=0; i<10000; i++)
-      counters.inc(rand()%1010,rand()%1010,rand()%10-5);
-
-    //  dumpDb(db);
-
-    counters.inc(100,200,5);
-    counters.inc(1000,2000,5);
-    counters.inc(1000,2500,4);
-    counters.inc(1000,2900,3);
-
-    counters.inc(1001,2900,3);
-
-    dumpDb(counters);
-    std::cout << "ready testing\n";
-  }
-
-  
-int main() {
-    Collocators counters = "/tmp/cdb";
-    std::cout << "testing now\n";
-    testCollocators(counters);
-    std::cout << "ready running\n";
-    return 0;
-}
