         guard let owner = owner else
             { return }
 
-        for i in observers.keys
-            { observers[i]?.removeOwner(owner) }
+        for observer in observers.values
+            { observer.removeOwner(owner) }
 
         cleanDefunctObservers()
         }

            { return }
        defunctObserverCheckCounter = 0

        for i in observers.keys
            { observers[i]?.cleanUp() }

        let removed = observers.removeValues { $0.isDefunct }


        cleanDefunctObservers()

        let identity = observer.observerIdentity
        if let observer = observers[identity]
            {
            // have to use observers[i] instead of loop var to
            // make mutator actually change struct in place in array
            observer.addOwner(owner)
            observersChanged()
            return self
            }

        let newEntry = ObserverEntry(observer: observer, resource: self)
        newEntry.addOwner(owner)
        observers[identity] = newEntry
        observer.resourceChanged(self, event: .observerAdded)
