   ;;  4 ([[0 3] [3 4]] [[1 2] [2 4]] ..
   ;;  5 ([[0 4] [4 5]] [[1 3] [3 5]] ... ) } ;; each pair has a combined size of 5.
   (cond
-    (< n 2)
+    (< max 2)
     nil
 
     true

                                          [x y])
                                        (range (+ x 1) (+ n 1))))
                              (range 0 n)))
          spans (square-cross-product (spanpairs n))]
      (merge
       {1 (map-fn
           (fn [i]
             [i (+ 1 i)])
           (range 0 n))}
       (reduce (fn [resultant-map this-submap]
                 (merge-with union ;; TODO: this could get expensive - consider alternatives.
                             resultant-map this-submap))

                            x)))
          x))

(defn span-map [max]
  "return a map of size -> _spans_, where _size_ is an integer, and _spans_ are all
   the [left,right] pairs whose combined size is equal to _size_., and _size_ ranges from 1 to _max_."
  ;; for example:
  ;; (span-map 5) =>
  ;; 
