     // MARK: NSCoding Functions
 
     func encode(with aCoder: NSCoder) {
+        // Called to archive the properties of the player instance
         aCoder.encode(pack, forKey:"ff.pack")
         aCoder.encode(citadelSpellMatrix, forKey:"ff.cspellmatrix")
+        aCoder.encode(templeSpellMatrix, forKey: "ff.tspellmatrix")
         aCoder.encode(modMatrix, forKey: "ff.modmatrix")
-        aCoder.encode(templeSpellMatrix, forKey: "ff.tspellmatrix")
         aCoder.encode(gameName, forKey: "ff.gamename")
         aCoder.encode(NSNumber(value: gamekind), forKey: "ff.gamekind")
         aCoder.encode(NSNumber(value: skill), forKey: "ff.skill")

    var potion: Int = -1
    var drinks: Int = 2

    var pack: [String] = []
    var packIcon: [Int] = []
    var packSelectedItem: Int = 0
    var citadelSpellMatrix: [Int] = []

    }

    required init(coder aDecoder: NSCoder) {
        // Called to de-archive the properties of the player instance
        self.pack = aDecoder.decodeObject(forKey: "ff.pack") as! [[String:Any]]

        var csm = aDecoder.decodeObject(forKey: "ff.cspellmatrix") as! [NSNumber]
        for i in 0...10 { citadelSpellMatrix.append(csm[i].intValue) }
        csm = aDecoder.decodeObject(forKey: "ff.tspellmatrix") as! [NSNumber]
        for i in 0...3 { templeSpellMatrix.append(csm[i].intValue) }
        csm = aDecoder.decodeObject(forKey: "ff.modmatrix") as! [NSNumber]
        for i in 0...3 { modMatrix.append(csm[i].intValue) }

        self.gameName = aDecoder.decodeObject(forKey: "ff.gamename") as! String
        self.gamekind = (aDecoder.decodeObject(forKey: "ff.gamekind") as! NSNumber).intValue
