 
 import Foundation
 
-class Team: NSObject {
+class Team: NSObject, NSCoding {
     
-    //Temporary storage
-    private static var teamList: [Team] = []
+    //MARK: Persistence names
+    static let teamListPropertyName = "zmon.team.teamList"
+    static let namePropertyName = "zmon.team.name"
+    static let observedPropertyName = "zmon.team.observed"
+    
+    private static var teamList: [Team] = {
+        //If teamList was previously persisted on disk, fetch it, otherwise return an empty array
+        let defaults = NSUserDefaults.standardUserDefaults()
+        let teamListData = defaults.objectForKey(Team.teamListPropertyName)
+        if teamListData != nil {
+            let teamList = NSKeyedUnarchiver.unarchiveObjectWithData(teamListData as! NSData)
+            return teamList as!  [Team]
+        }
+        
+        return []
+        
+    }()
     
     //MARK: Properties
     var name: String

        self.name = name
        self.observed = observed
    }
    
    func save() {
        let idx = Team.teamList.indexOf { (team: Team) -> Bool in

            Team.teamList.removeAtIndex(idx!)
            Team.teamList.append(self)
        }
        
        self.persistObservedTeams()
    }
    
    func persistObservedTeams() {
        let defaults = NSUserDefaults.standardUserDefaults()
        let data = NSKeyedArchiver.archivedDataWithRootObject(Team.teamList)
        
        defaults.setObject(data, forKey: Team.teamListPropertyName);
    }
    
    static func findByName(name name: String) -> Team? {
