 +  char **id_array = NULL;
 +  uint64_t max = 0;
 +  switch(type){
-+  case ilmInst:		id_array = inst; 	max = ILM_MAX_LANE; break;
-+  case ilm18Inst:	id_array = inst18; 	max = ILM18_MAX_LANE; break;
++  case ilmInst:		id_array = inst; 	max = ILM_MAX_INST; break;
++  case ilm18Inst:	id_array = inst18; 	max = ILM18_MAX_INST; break;
 +  case ilm18Flowcell:	id_array = flowcell18; 	max = ILM18_MAX_FLOW; break;
 +  }
 +  long i;

+  int const instID = getIlluminaFieldID(ilmInst, qn, s);
+  if (instID != -1) {
+    uint64_t vl = strtol(s+1, &endp, 10);
+    if ((s+1 < endp && ':' == *endp) || vl-1 <= ILM_MAX_LANE){ // v is lane
+      char * endp2;
+      uint64_t vn = strtol(endp+1, &endp2, 10);
+      if ((endp+1 < endp2 && ':' == *endp2) || vn <= ILM_MAX_TILE){ // v is number within lane
+        char * endp3;
+        uint64_t vx = strtol(endp2+1, &endp3, 10);
+        if ((endp2+1 < endp3 && ':' == *endp3) || vx <= ILM_MAX_X){ // v is x
+          char * endp4;
+          uint64_t vy = strtol(endp3+1, &endp4, 10);
+          if (endp3+1 < endp4 || vy <= ILM_MAX_Y){ // v is y
+	    // | instrument id | lane no. | tile no. | x       | y       | 
+	    // |       8 bits  | 5 bits   | 14 bits  | 17 bits | 20 bits |
+  	    c = ((uint64_t)instID)<<(ILM_BITS_LANE+ILM_BITS_TILE+ILM_BITS_X+ILM_BITS_Y)

+  str[n++] = ':';
+  n += snprintf(&str[n], l_qname-n, "%lu", y);
+  *len = n;
+  if (n + 1/*\0*/ > l_qname) {
+    fprintf(stderr, "(E) length of string buffer %ld must be >=%d\n", l_qname, n + 1);
+    exit(-1);
+  }
+}
+
+static void get_qname(uint64_t qnameid, char *qname, long l_qname, long *len) {
