 
 class Session: NSObject {
 
-    var startDate: NSNumber?
+    var start: NSNumber?
     var duration: NSNumber?
-    var endDate: NSNumber?
+    var end: NSNumber?
     var cycle: NSNumber?
 
-    func remaining(time: Int64) -> Int64 {
-        if !isInPeriod(time: time) {
+    func remaining(_ time: Int64) -> Int64 {
+        if !isInPeriod(_ time: time) {
             return -1
         }
 

        var t: Int64!

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


        if !session.isInPeriod(time: currentTime) {
            return false
        } else {
            return session.remaining(currentTime) > 0
        }
    }

