 
 class ScoresController {
 
-    private var persistentContainer: NSPersistentContainer!
+    private let persistentContainer: NSPersistentContainer
 
     init(_ persistentContainer: NSPersistentContainer) {
         self.persistentContainer = persistentContainer


    func addScore(_ score: Score) {
        let context = persistentContainer.viewContext
        guard let entity = NSEntityDescription.entity(forEntityName: "Score", in: context)
            else { fatalError() }
        let scoreMO = NSManagedObject(entity: entity, insertInto: context)
        scoreMO.setValue(score.date,     forKey: "date")
        scoreMO.setValue(score.numCols,  forKey: "numCols")
        scoreMO.setValue(score.numMines, forKey: "numMines")

            fatalError("Core Data coordinator: failed to execute request with error \(error)")
        }
    }
}
