for(i = 0; i < len; i++) {
   const char *field;
   double tmp;
   int err;

   if(tdf_getLine(tdf) < 0 || tdf_getNumFields(tdf) > (i+1)) {
      ERRLINE(tdf_getCurLine(tdf), "too many fields");
      freeTabDelimFile(tdf);
      freeLabelList(tlabels);
      free(tmat);
      return -4;
   }

   field = tdf_getField(tdf, 0);
   if(ll_getIndex(tlabels, field, &err) > 0 || err == 0) {
      ERRLINE(tdf_getCurLine(tdf), "duplicate vertex label");
      freeTabDelimFile(tdf);
      freeLabelList(tlabels);
      free(tmat);
      return -4;
   }
   if(ll_appendLabel(tlabels, field) < 0) {
      ERRLINE(-1, "");
      freeTabDelimFile(tdf);
      freeLabelList(tlabels);
      free(tmat);
      return -3;
   }

   for(j = 0; j < i; j++) {
      shift-= valbits;

      tmp = tdf_getFieldAsFloat(tdf, j+1, &err);
      if(tmp == 0 && err != 0) {
         if(err == -2) {
            *pos|= (MYTYPE)(flag<<shift);
         } else {
            ERRLINE(tdf_getCurLine(tdf), "non-numeric value provided");
            freeTabDelimFile(tdf);
            freeLabelList(tlabels);
            free(tmat);
            return -4;
         }
      } else if(DOABS(tmp) >= (threshold-(1e-6))) {
         *pos|= (MYTYPE)((((MYTYPE)(tmp*denom))&mask)<<shift);
      } else {
         *pos|= (MYTYPE)(flag<<shift);
      }

      if(shift == 0) {
         shift = numvals*valbits;
         pos++;
      }
   }
}
