                         for ex in exceptions! {
                             if isInSession(ex, future) {
                                 isException = true
-                                exDif = min(nextChange(time: future), exDif)
+                                exDif = min(nextChange(future), exDif)
                             }
                         }
                         if isException {

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


        return (session != nil)
    }

    func nextChange(_ time: Int64) -> Int64 {
        let currentSession = findCurrentSession(time: time)
        if currentSession != nil {
            let nearestException = findNearest(exceptions, nil, time)
            let remaining = currentSession?.remaining(time)

            return min(remaining!, nearestException)
        } else {
