 
 (defn get-component
     "Get the component data for a specific component type"
+    [system entity type]
+    (-> system :entity-components (get-in [type entity])))
+
+#_
+(defn get-component
+    "Get the component data for a specific component type"
     [entity type]
     (get-in @entity-components [type entity]))
 
 (defn get-all-entities-with-component
     "Get all the entities that have a given component type"
-    [type]
-    (if-let [entities (keys (get @entity-components type))]
+    [system type]
+    (if-let [entities (-> system :entity-components (get type) keys)]
         entities
         []))
 
+(defn remove-component
+    "Remove a component instance from an entity"
+    [system entity instance]
+    (let [type (get-component-type instance)
+          system (transient system)
+          entity-components (:entity-components system)
+          entity-component-types (:entity-component-types system)]
+        (-> system
+            (assoc! :entity-components (assoc! entity-components type (-> entity-components (get type) (dissoc! entity))))
+            (assoc! :entity-component-types (assoc! entity-component-types entity (-> entity-component-types (get entity) (disj! type))))
+            persistent!)))
+
+#_
 (defn remove-component!
     "Remove a component instance from an entity"
     [entity instance]

    [system]
    (:all-entities system))

(defn store-entity
    "Store the entity in the Entity System"
    [system entity]
    (let [system (transient system)]
        (->
            system
            (assoc! :all-entities (conj! (get-all-entities) entity))
            (assoc! :entity-component-types (assoc! (:entity-component-types system) entity #{}))
            persistent!)))

#_


(defn create-entity
    "Create the entity and return it. Entities are just UUIDs"
    []
    (java.util.UUID/randomUUID))

(defn get-all-entities
