 
         return nil
     }
-}
-
-class Session: NSObject {
+
+
+    override init() {
+        super.init()
+    }
+
+    required init(instance: TimeTable) {
+        self.humanReadable = instance.humanReadable
+        if let sessionArray = instance.sessions {
+            var ses = [Session]()
+            for item in sessionArray {
+                ses.append(item.clone())
+            }
+            self.sessions = ses
+        }
+
+        if let excepArray = instance.exceptions {
+            var exc = [Session]()
+            for item in excepArray {
+                exc.append(item.clone())
+            }
+            self.sessions = exc
+        }
+    }
+}
+
+class Session: NSObject, Copyable {
 
     var start: NSNumber?
     var duration: NSNumber?

                var t: Int64!

                if session.cycle!.int64Value <= 0 {
                    s = session.startDate!.int64Value
                    t = time
                } else {
                    s = session.startDate!.int64Value % session.cycle!.int64Value
                    t = time % session.cycle!.int64Value
                }


    var cycle: NSNumber?

    func remaining(_ time: Int64) -> Int64 {
        if !isInPeriod(time) {
            return -1
        }

