     public func databaseWillCommit() throws { }
     public func databaseDidRollback(db: Database) { }
     public func databaseDidCommit(db: Database) {
-        let newRecords = T.fetchAll(db, self.sql)
+        let newResults = T.fetchAll(db, self.sql)
         dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0)) {
-            let oldRecords = self.fetchedResults
+            let oldResults = self.fetchedResults
             
             // horrible diff computation
             dispatch_async(dispatch_get_main_queue()) {
                 self.delegate?.controllerWillUpdate(self)
                 
                 // after controllerWillChangeContent
-                self.fetchedResults = newRecords
+                self.fetchedResults = newResults
                 
                 // notify horrible diff computation
-                for update in self.diff(fromRows: oldRecords!, toRows: newRecords) {
+                for update in FetchedResultsController.diff(fromRows: oldResults!, toRows: newResults) {
                     self.delegate?.controllerUpdate(self, update: update)
                 }
                 

                    var del = d[i - 1][j] // a deletion
                    var ins = d[i][j - 1] // an insertion
                    var sub = d[i - 1][j - 1] // a substitution
                    
                    // Record operation.
                    
                    let minimumCount = min(del.count, ins.count, sub.count)
                    if del.count == minimumCount {


    
    /// Returns the fetched object at a given indexPath.
    public func resultAtIndexPath(indexPath: NSIndexPath) -> T? {
        if let result = fetchedResults?[indexPath.indexAtPosition(1)] {
            return result
        } else {
            return nil
        }
    }
    
    /// Returns the indexPath of a given object.
    public func indexPathForResult(result: T) -> NSIndexPath? {
        return nil
    }

    public func changesAreEquivalent(change: Change<T>, otherChange: Change<T>) -> Bool {
        switch (change, otherChange) {
        case (.Move(let item1, let from1, let to1), .Move(let item2, let from2, let to2)):
            return (from1 == to2 && to1 == from2 && item1 == resultAtIndexPath(from2) && item2 == resultAtIndexPath(from1))
        default:
            return false
        }
    }

    // MARK: - Not public
    
    func fetchResults() -> [T] {
        return databaseQueue.inDatabase { db in
            T.fetchAll(db, self.sql)
        }
    }
    
    static func diff(fromRows s: [T], toRows t: [T]) -> [Change<T>] {
        
        let sourceCount = s.count
        let targetCount = t.count
