               (if (nil? t)
                 new-t
                 (go (branch t) branch (xconj new-t branch (f (:val t))))))]
-    (go (:L t) :L (go (:R t) :R (xconj nil nil (f (:val t)))))))+    (go (:L t) :L (go (:R t) :R (xconj nil nil (f (:val t)))))))
+

                (let [val (:val t) new-max (if (nil? acc) val (max val acc))]
                  (max (go (:R t) new-max) (go (:L t) new-max)))))]
    (go t nil)))
;fpins

;-----------------------------------------------------------------------

;3.27

  (letfn [(go [t acc]
              (if (nil? t)
                acc
                ;my solution is wrong here :| I am passing same acc to both
                ;left and right path walk
                (+ (go (:L t) (inc acc)) (go (:R t) (inc acc)))))]
    (+ (go (:L t) 0) (go (:R t) 0))))
;fpins - no pattern matching
(defn t-size-fpins [t]
  (if (and (nil? (:R t)) (nil? (:L t)))
    1
    (+ 1 (t-size-fpins (:R t)) (t-size-fpins (:L t)))))
;fpins - with pattern matching
(defn t-size-fpins-revisited [t]
  (match [t]
         [(:or {:val _ :R nil :L nil} nil)] 1
         [{:val _ :R r :L l}] (+ 1 (t-size-fpins-revisited r) (t-size-fpins-revisited l))))
;-----------------------------------------------------------------------

;3.26
