 
 (defn- find-first [pred coll] (first (filter pred coll)))
 
+(defn checked-index [items index id-keyword value]
+    (let [index-valid? (> (count items) index)
+          proposed-item (if index-valid? (get items index) nil)
+         ]
+     (cond (and proposed-item
+                (= value (get proposed-item id-keyword))) index
+           :otherwise (->> (map-indexed vector items) (find-first #(= value (id-keyword (second %)))) (first))
+           )
+     )
+  )
+
 (defn resolve-data-path [state path-seq]
   (reduce (fn [real-path path-ele]
             (if (sequential? path-ele)
               (do
-                (if (not= 3 (count path-ele))
-                  (logging/log "ERROR: VECTOR BASED DATA ACCESS MUST HAVE A 3-TUPLE KEY")
+                (if (not= 4 (count path-ele))
+                  (logging/log "ERROR: VECTOR BASED DATA ACCESS MUST HAVE A 4-TUPLE KEY")
                   (let [vector-key (first path-ele)
                         state-vector (get-in state (conj real-path vector-key))
                         lookup-function (second path-ele)
                         target-value (nth path-ele 2)
-                        index (->> (map-indexed vector state-vector) (find-first #(= target-value (lookup-function (second %)))) (first))
+                        proposed-index (nth path-ele 3)
+                        index (checked-index state-vector proposed-index lookup-function target-value)
                         ]
                     (if index
                       (conj real-path vector-key index)

          [] path-seq))

(defn data-path
  "Used by internal context tracking to correct the internal path to account for the inclusion of vectors as data structures 
  pointing to items in vectors."
  [context]
  (let [state @(-> context :application :app-state)


(defn update-in-context
  "Update the application state by applying the given operation to the state of the component implied by
  the given context. Think of this as a 'targeted' `swap!` where you don't have to know where the data is
  stored. This function also records the change in this state history with an optional associated Reason."
  [context operation undoable compressable reason]
  (let [application (-> context :application)
