         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))

                (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]]

  (POST "/multimodqry" [languages pos] (handle-multimodqry languages pos))
  (POST "/multimoddisplay" [valclusters pos] (handle-multimoddisplay valclusters pos))
  ;;(POST "/multimodplldisplay" [pdgmnames header pdgmstr2] (handle-multimodplldisplay2 pdgmnames header pdgmstr2)))  
(POST "/multimodplldisplay" [pdgmnames header pdgmstr2 pivotlist] (handle-multimodplldisplay4 pdgmnames header pdgmstr2 pivotlist)))
