 
     public var collapseDetailViewController = true
     
-    var dataManager : DataManager? = nil
-    
-    public func createDataManager() {
-        dataManager = DataManager()
-    }
+    let dataManager : DataManager = DataManager()
 
     public func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
         self.window = UIWindow(frame: UIScreen.mainScreen().bounds)
         self.window?.backgroundColor = UIColor.whiteColor()
         self.window?.makeKeyAndVisible()
-        
-        if dataManager == nil {
-            createDataManager()
-        }
         
         UINavigationBar.appearance().tintColor = UIColor.darkGreenColor()
         UIBarButtonItem.appearance().tintColor = UIColor.darkGreenColor()

    }
    
    public func application(application: UIApplication, didReceiveLocalNotification notification: UILocalNotification) {
        if dataManager == nil {
            createDataManager()
        }
        
        let str = application.applicationState == .Active ? "Active" : application.applicationState == .Inactive ? "Inactive" : "Background"
        if let splitView = self.window?.rootViewController as? UISplitViewController {
            if let nc = splitView.viewControllers.first as? UINavigationController {

    public func applicationWillTerminate(application: UIApplication) {
        // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
        // Saves changes in the application's managed object context before the application terminates.
        dataManager.managedObjectContext.save(nil)
    }

    // MARK: - Core Data stack
