             (assoc! :entity-component-types (-> system :entity-component-types (assoc entity #{})))
             persistent!)))
 
-#_
-(defn create-entity!
-    "Creates an entity and returns it. An entity is just an UUID"
-    []
-    (let (java.util.UUID/randomUUID)
-        (dosync
-            (alter all-entities conj entity)
-            (alter entity-component-types assoc entity #{}))
-        entity))
-
 (defmulti get-component-type
           "Returns the type for a given component. Using a multimethod with 'class' as the dispatch-fn to allow for extensibility per application.
           By default returns the class of the component."

            (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]
    (let [type (get-component-type instance)]
        (dosync
            (alter entity-components assoc type (dissoc (get @entity-components type) entity))
            (alter entity-component-types assoc entity (disj (get @entity-component-types entity) type)))))

#_
(reduce (fn [v e]
            (assoc v e (dissoc (get v e) :e)))
        m k)

(defn kill-entity
    "Destroy an entity completely."
    [system entity]

                                                            (transient (:entity-components system)) (get entity-component-types entity))))
            persistent!)))

(defn get-all-components-on-entity
    "Get all the components on a specific entity. Useful for debugging"
    [system entity]
