 ;; `wids` is defined in section 3.4 of the paper. This is the variant
 ;; of the algorithm that also covers the case where range and slide
 ;; are defined on the same value.
-(defn wids-lower [min-windowing-attr w-slide t]
-  (dec (long (Math/floor (/ (- (:window-key t)
+(defn wids-lower [min-windowing-attr w-slide w-key t]
+  (dec (long (Math/floor (/ (- (get t w-key)
                                min-windowing-attr) w-slide)))))
 
-(defn wids-upper [min-windowing-attr w-range w-slide t]
-  (dec (long (Math/floor (/ (- (+ (:window-key t) w-range)
+(defn wids-upper [min-windowing-attr w-range w-slide w-key t]
+  (dec (long (Math/floor (/ (- (+ (get t w-key) w-range)
                                min-windowing-attr) w-slide)))))
 
-(defn wids [min-windowing-attr w-range w-slide t]
-  (let [lower (wids-lower min-windowing-attr w-slide t)
-        upper (wids-upper min-windowing-attr w-range w-slide t)]
+(defn wids [min-windowing-attr w-range w-slide w-key t]
+  (let [lower (wids-lower min-windowing-attr w-slide w-key t)
+        upper (wids-upper min-windowing-attr w-range w-slide w-key t)]
     (range (inc lower) (inc upper))))
 
 ;; The follow code runs through 30 segments with

   "one segment per fixed window" 100000
   [w-range-and-slide gen/s-pos-int
    w-attr gen/pos-int]
   (let [segment {:window-key w-attr}
         buckets (wids 0 w-range-and-slide w-range-and-slide segment)]
     (is (= 1 (count buckets))))))

(deftest sliding-windows

   [w-slide gen/s-pos-int
    multiple gen/s-pos-int
    w-attr gen/pos-int]
   (let [w-key :window-key
         segment {:window-key w-attr}
         buckets (wids 0 (* multiple w-slide) w-slide w-key segment)]
     (is (= multiple (count buckets))))))

(deftest inverse-functions
