 (defn jobs     []     (map :content (filter #(= (:tag %) :Job) (tree))))
 (defn re       [user] (re-pattern (str user "@.*")))
 (defn tags     [job]  (map #(:tag %) job))
-(defn tree     []     (:content (parse (java.io.StringBufferInputStream. (xml)))))
 (defn xattr    [j,k]  (first (k j)))
 (defn xjobid   [j]    (xattr j :Job_Id))
 (defn xml      []     (:out (sh "qstat" "-x")))
 (defn xname    [j]    (xattr j :Job_Name))
+(defn xnodes   [j]    (if (= "-" (xprocs j)) (xres j :nodect) "-"))
 (defn xowner   [j]    (xattr j :Job_Owner))
 (defn xqueue   [j]    (xattr j :queue))
+(defn xprocs   [j]    (let [procs (xres j :procs) ] (if (nil? procs) "-" procs)))
+(defn xres     [j,k]  (first (:content (first (filter #(= (:tag %) k) (:Resource_List j))))))
 (defn xrtime   [j]    (xtime j :Resource_List))
 (defn xstate   [j]    (xattr j :job_state))
 (defn xtime    [j,k]  (first (:content (first (filter #(= (:tag %) :walltime) (k j))))))
 (defn xutime   [j]    (let [t (xtime j :resources_used)] (if (nil? t) "-" t)))
+
+(defn tree []
+  (try (:content (parse (java.io.StringBufferInputStream. (xml))))
+       (catch Exception e)))
 
 (defn xpart [j]
   (let [p (first (:content (first (filter #(= (:tag %) :partition) (:Resource_List j)))))]

  (let [j (jobraw job)]
    {:jobid (xjobid j)
     :name  (xname  j)
     :owner (xowner j)
     :part  (xpart j)
     :queue (xqueue j)
     :rtime (xrtime j)
     :state (xstate j)

  (do
    (.setFont ta (Font. "Monospaced" (Font/PLAIN) 12))
    (doto fr
      (.setSize 800 600)
      (.setLayout (BorderLayout.))
      (.add ta BorderLayout/CENTER)
      (.setDefaultCloseOperation JFrame/EXIT_ON_CLOSE)
