   "Format entity state for use with spatial index. Includes all
    collision component state in the metadata of the spatial tree item"
   [id {:keys [pos-x pos-y offset-x offset-y]} {:keys [height width attributes]}]
-  (rbush-item pos-x
+  (r/rbush-item pos-x
               pos-y
               ;; Adjust the width and height of the bounding box based
               ;; on where the entity will be next frame


(defn get-or-create-spatial-index
  [state max-entries]
  (get-in state spatial-index-location (rbush max-entries)))

(defn mk-broad-collision-system
  "Returns a system function that creates a spatial index with max-entries.

           items (array)]
      (let [entity-id (first entities)]
        (if (nil? entity-id)
          (r/rbush-bulk-insert! index items)
          (let [move-state (get moveable-states entity-id)
                collision-state (get collidable-states entity-id)]
            (when (not (and (nil? move-state) (nil? collision-state)))
