Hello, it is really simple to keep collision lists sorted. However, I get error about typeset not being found. Debugged that typeset is inserted into builtintab. I am pretty exhausted, maybe someone will have a revelation on this. Debugged that typeset is being searched in: exec.c:729 if ((cn = (Cmdnam) cmdnamtab->getnode(cmdnamtab, arg0))) { at final stage, so it apparently misses builtintab search before. Below is the main idea, attached is full patch. -       if (ht->cmpnodes(hp->nam, hn->nam) == 0) { +        cres = ht->cmpnodes(hp->nam, hn->nam); +       if ( cres == 0 ) {             hq->next = hn;             goto replacing; -       } +       } else if ( cres > 0 ) { +            /* Pointer `hp` is at 'right' position - it points +             * to a greater element than `hn`, so we should +             * insert at one-before, that is after `hq` */ +            hq->next = hn; +            hn->next = hp; +            if (++ht->ct >= ht->hsize * 2 && !ht->scan) +                expandhashtable(ht); +            return NULL; +        } -- Sebastian Gniazdowski psprint /at/ zdharma.org