         pmaps (for [prmap prmaps] (apply conj prmap))
         headerset3 (clojure.string/replace headerset2 #"[\[\]\"]" "")
         heads (split (str headerset3) #" ")
-        headvec (vec-remove heads pivot)
-        ;; pdgmnums (into [] (take (clojure.core/count pnames) (iterate inc 1)))
+        headvec (vec-remove heads pivotlist)
         ;; set of lists of vaue-combination-terms
         keylists (set (for [pmap pmaps] (keys pmap)))
         ;;keylists (set (keys pmap))

  (let [hmap1 (split prmp #" ")
        hmap2 (apply hash-map hmap1)]
    (clojure.walk/keywordize-keys hmap2)))
        
(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 pivotname]
  (let [pnamestr (clojure.string/replace pdgms #"[\[\]\"]" "")
        pnames (split pnamestr #" ")
        pivot (read-string pivotname)
        ;; get rid of spurious line-feeds
        ;;pdgmstr2a (str pdgmstr2)
        pdgmstr3 (cleanpdgms pdgmstr2)
        ;; map each 'val-string-w/o-pivot-val token' to token
        prows (split pdgmstr3 #"\\r\\n")
        pcells (for [prow prows] (split prow #","))
        pivot-map (for [prow pcells] (hash-map (nth prow pivot) (vec-remove prow pivot)))
        ;; group the val-tokens associated with each pivot val
        newpdgms (merge-matches pivot-map)
        ;; make a vector of pivot vals
        pvalvec (vec (for [npdgm newpdgms] (str (key npdgm))))
        ;; e.g., ["Plural" "Singular"]
        ;; make a vector of pdgm rows for each pivot

                (for [npg npgs]
                  [:td npg])
                (for [pmap pmaps]
               [:td (kstrkey pmap)])])]) ]]
       [:div [:h4 "======= Debug Info: ======="]
        [:p "pnames: " (str pnames)]
        [:p "headerset2: " [:pre headerset2]]
        ;; [:p "pivot: " [:pre pivot]]
        [:p "heads: " (str heads)]
        [:p "headvec: " (str headvec)]
        [:p "prows: "  (str prows) [:pre prows]]
        [:p "pcells: " (println (str pcells)) [:pre pcells]]
        [:p "pivot-map: " [:pre pivot-map]]
        [:p "newpdgms: " [:pre newpdgms]]
        [:p "pvalvec: " (str pvalvec) [:pre pvalvec]]
        [:p "pdgmstr2: " [:pre pdgmstr2]]
        ;;[:p "vvec: " [:pre vvec]]
        [:p "vvec: " (str vvec)]
        [:p "pmapvec: " [:pre pmapvec]]
        [:p "prmaps: " [:pre prmaps]]
        [:p "pmaps: " [:pre pmaps]]
        [:p "keylists: " [:pre keylists]]
        [:p "keystring: " [:pre keystring]]
        [:p "keyset: " [:pre keyset]]
        [:p "==========================="]]
      [:script {:src "js/goog/base.js" :type "text/javascript"}]
      [:script {:src "js/webapp.js" :type "text/javascript"}]
      [:script {:type "text/javascript"}
       "goog.require('webapp.core');"]])))


(defroutes multipdgmmod-routes
