diff --git a/w2v-server.c b/w2v-server.c
index 3a8092c..df66371 100644
--- a/w2v-server.c
+++ b/w2v-server.c
@@ -114,7 +114,7 @@
   return 1;
 }
 
-int init_net(char *file_name, char *net_name, int latin) {
+int init_net(char *file_name, char *net_name, int latin, int do_open_cdb) {
   FILE *f, *binvecs, *binwords;
   int binwords_fd, binvecs_fd, net_fd, i;
   long long a, b, c, d, cn;
@@ -218,15 +218,17 @@
     }
     fprintf(stderr, "Successfully memmaped %s. Determined window size: %d\n", net_name, window);
 
-    char collocatordb_name[2048];
-    strcpy(collocatordb_name, net_name);
-    char *ext = rindex(collocatordb_name, '.');
-    if (ext) {
-      strcpy(ext, ".rocksdb");
-      if (access(collocatordb_name, R_OK) == 0) {
-        *ext = 0;
-        fprintf(stderr, "Opening collocator DB	%s\n", collocatordb_name);
-        cdb = open_collocatordb(collocatordb_name);
+    if (do_open_cdb) {
+      char collocatordb_name[2048];
+      strcpy(collocatordb_name, net_name);
+      char *ext = rindex(collocatordb_name, '.');
+      if (ext) {
+        strcpy(ext, ".rocksdb");
+        if (access(collocatordb_name, R_OK) == 0) {
+          *ext = 0;
+          fprintf(stderr, "Opening collocator DB	%s\n", collocatordb_name);
+          cdb = open_collocatordb(collocatordb_name);
+        }
       }
     }
   }
@@ -449,6 +451,33 @@
   pthread_exit(nbs);
 }
 
+float getOutputWeight(int hidden, long target, int window_position) {
+  const long window_layer_size = size * window * 2;
+  int a;
+
+  if (window_position == 0 || window_position > window || window_position < -window) {
+    fprintf(stderr, "window_position: %d - assert: -%d <= window_position <= %d && window_position != 0 failed.\n", window_position, window, window);
+    exit(-1);
+  }
+
+  if (hidden >= size) {
+    fprintf(stderr, "hidden: %d - assert: hidden < %d failed.\n", hidden, size);
+    exit(-1);
+  }
+
+  if (target >= words) {
+    fprintf(stderr, "target: %ld - assert: target < %ld failed.\n", target, words);
+    exit(-1);
+  }
+
+  a = window_position + window;
+  if (a > window) {
+    --a;
+  }
+  long window_offset = a * size;
+  return syn1neg_window[target * window_layer_size + window_offset + hidden];
+}
+
 AV *getVecs(AV *array) {
   int i, b;
   AV *result = newAV();
