         vvec (for [npdgm newpdgms] (val npdgm))
         pmapvec (for [vgroup vvec] (for [vrow vgroup] (vec2map vrow)))
         ;; transform pmaps to hash-maps
-        prmaps (for [prmap pmapvec] (for [prmp prmap] (pstring2map prmp)))
-        pmaps (for [prmap prmaps] (apply conj prmap))
+        prmaps (for [prmap pmapvec] (for [prmp prmap] (pstring2maps prmp)))
+        ;;pmaps (for [prmap prmaps] (apply conj prmap))
+        pmaps (join-pmaps prmaps)
         headerset3 (clojure.string/replace headerset2 #"[\[\]\"]" "")
         heads (split (str headerset3) #" ")
         ;;headvec (for [pivot pivotlist] (vec-remove heads pivotlist))
         pivotnames (vec (for [pivot pivots] (nth heads pivot)))
         headvec (vec (remove (set pivotnames) heads))
         ;; set of lists of vaue-combination-terms
-        keylists (set (for [pmap pmaps] (keys pmap)))
+        keylists (vec (for [pmap pmaps] (keys pmap)))
         ;;keylists (set (keys pmap))
-        ;; why is replace necessary; none of deleted chars should be in keys
-        keystring (clojure.string/replace (str keylists) #"[#(){}]" "")
+        ;; replace seems to be ad hoc cluj; 
+        ;; only '[' and ']' appear in one-line paradigm keyvec (but should not)
+        ;; other deleted chars should not be in keys in the first place
+        keystring (clojure.string/replace (str keylists) #"[#(){}\[\]]" "")
         keyvec (split keystring #" ")
         ;; set of all value combinations, as strings, in the combined pdgms
         keyset (set keyvec)

   (clojure.string/replace prow #"(.*),(.*?$)" "$1 $2")))
;;(clojure.string/replace (join "," row) #"(.*),(.*?$)" "$1 $2"))

(defn pstring2map
  "Used in handle-multimodplldisplay4. Takes pivot property out of comma-separated properties in pdgm string, and arranges the rest as a set of {:property-list 'token'} maps" 
  [prmp] 
  (let [hmap1 (split prmp #" ")
        hmap2 (apply hash-map hmap1)]
    (clojure.walk/keywordize-keys hmap2)))

(defn handle-multimodplldisplay
  "In this version pivot/keyset can be generalized beyond png any col (eventually any sequence of cols) between col-1 and token column. (Need to find out how to 'presort' cols before initial display?)"

                (for [npg npgs]
                  [:td npg])
                (for [pmap pmaps]
                  (let [pmap1 (clojure.string/replace (kstrkey pmap) #"_" " ")] 
               [:td pmap1]))])]) ]]
      [:p " "]
      [:p " "]
       [:div [:h4 "======= Debug Info: ======="]
