               
                 let entityType = into.entityClass as! T.Type
               
-                var importSourceByID = Dictionary<T.UniqueIDType, T.ImportSource>()
-              
+                var mapping = Dictionary<T.UniqueIDType, T.ImportSource>()
                 let sortedIDs = try autoreleasepool {
                   
                     return try sourceArray.flatMap { (source) -> T.UniqueIDType? in

    }
    
    /**
     Updates existing `ImportableUniqueObject`s or creates them by importing from the specified array of import sources. 
     Objects are called with `ImportableUniqueObject` methods in the same order as in import sources array.
     The array returned from `importUniqueObjects(...)` correctly maps to the order of `sourceArray`.
     
     - parameter into: an `Into` clause specifying the entity type
     - parameter sourceArray: the array of objects to import values from

                            return nil
                        }
                        
                        mapping[uniqueIDValue] = source
                        return uniqueIDValue
                    }
                }
                
                mapping = try autoreleasepool { try preProcess(mapping) }
                
                var objects = Dictionary<T.UniqueIDType, T>()
                for object in self.fetchAll(From(entityType), Where(entityType.uniqueIDKeyPath, isMemberOf: sortedIDs)) ?? [] {
                    
                    try autoreleasepool {
                        
                        let uniqueIDValue = object.uniqueIDValue
                        
                        guard let source = mapping.removeValue(forKey: uniqueIDValue),
                            entityType.shouldUpdate(from: source, in: self) else {
                                
                                return
                        }
                        
                        try object.update(from: source, in: self)
                        objects[uniqueIDValue] = object
                    }
                }
                
                for (uniqueIDValue, source) in mapping {
                    
                    try autoreleasepool {
                        
                        guard entityType.shouldInsert(from: source, in: self) else {
                            
                            return
                        }
                        
                        let object = self.create(into)
                        object.uniqueIDValue = uniqueIDValue
                        try object.didInsert(from: source, in: self)
                        
                        objects[uniqueIDValue] = object
                    }
                }
                
                return sortedIDs.flatMap { objects[$0] }
            }
    }
}
