     2array ;
 
 : add-out ( seq partition -- partition' )
-    [ out>> append ] [ in>> ] bi swap parts boa ;
+    [ nip in>> ] [ out>> append ] 2bi parts boa ;
 
-: intersection ( seq -- elts )
+: intersection ( seq -- elts/f )
     [ f ] [ unclip [ intersect ] reduce ] if-empty ;
 
 : meaningful-integers ( partition table -- integers )

            [
                _ swap '[ _ get-transitions ] assoc-map
                harvest-values
            ] preserving-epsilon
        ] assoc-map
    ] change-transitions ;


: add-integers ( partitions classes integers -- partitions )
    class-integers '[
        [ _ meaningful-integers ] [ ] bi add-out
    ] map ;

:: class-partitions ( classes -- assoc )
    classes [ integer? ] partition :> ( integers classes )

    classes powerset-partition classes integers add-integers
    [ [ partition>class ] [ ] bi 2array ] map sift-keys
    integers [ classes singleton-partition ] map append ;

: new-transitions ( transitions -- assoc ) ! assoc is class, partition
    values [ keys ] gather [ tagged-epsilon? ] reject class-partitions ;

: get-transitions ( partition state-transitions -- next-states )
    [ in>> ] dip '[ _ at ] gather sift ;

: disambiguate ( nfa -- nfa )
    expand-ors [
