 (defn make-random [seed]
   (doto (Random. (long seed)) (.nextDouble) (.nextDouble)))
 
-(defn pseudo-shuffle [#^java.util.Collection coll #^Random r]
-  (seq (java.util.Collections/shuffle (java.util.ArrayList. coll) r)))
+(defn pseudo-shuffle [#^Random r #^java.util.Collection coll]
+  (seq (doto (java.util.ArrayList. coll) (java.util.Collections/shuffle r))))
 
 (defn spiral-to [max-d] 
   (cons [0 0] 

; can grasp from any direction (gripper next to obj).
; For "fairness", only allow putdown in goal region ? 

; Actions:
; unpark, u/d/l/r, park (for base)
; gu/gl/gr/gl

    (when (and o (not (= o :border)))
      (make-pickup dirname base go o opos))))

(defn make-putdown [dirname base go o opos]
  (env/FactoredPrimitive 
       [:putdown dirname]
       {[:base] base [:gripper-offset] go [:parked?] true 
        [:holding] o [:object-at opos] nil}
       {[:pos o] opos [:holding] nil [:object-at opos] o [:at-goal? o] true}
       -1))

(defn make-putdown-dir [s [dirname dir]]
  (let [const (env/get-var s :const)
