         pmaps (for [prmap prmaps] (apply conj prmap))
         headerset3 (clojure.string/replace headerset2 #"[\[\]\"]" "")
         heads (split (str headerset3) #" ")
-        headvec (vec-remove heads pivotlist)
+        ;;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 (set (keys pmap))

        hmap2 (apply hash-map hmap1)]
    (clojure.walk/keywordize-keys hmap2)))

(defn make-pivot-map
  [prow pivots]
  ;; build up pkey and pval, then hash-map
  (for [pivot pivots]
    (let [pkey (nth prow pivot)])))
  
        
(defn handle-multimodplldisplay4
  "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?)"
  [pdgms headerset2 pdgmstr2 pivotlist]
  (let [pnamestr (clojure.string/replace pdgms #"[\[\]\"]" "")
        pnames (split pnamestr #" ")
        ;;pivot (read-string pivotname)
        ;; get rid of spurious line-feeds
        ;;pdgmstr2a (str pdgmstr2)

                (for [pmap pmaps]
               [:td (kstrkey pmap)])])]) ]]
       [:div [:h4 "======= Debug Info: ======="]
        [:p "pdgms: " [:pre pdgms]]
        [:p "pnames: " (str pnames)]
        [:p "headerset2: " [:pre headerset2]]
        [:p "pivotlist: " (str pivotlist)]
        [:p "pivotnames: " (str pivotnames)]
        [:p "heads: " (str heads)]
        [:p "headvec: " (str headvec)]
        [:p "prows: "  (str prows) [:pre prows]]
