     let app: App
     let name: String
     var actionCost = 0.0
+    var timeCosts = [String:Double]()
+    var firstActed: Double?
     var actionLimit: Double?
-    var firstActed: Double?
-    var timeLimit: Double?
-    var restTime: Double = 0
+    var timeLimits = [String:Double]()
+    var restTime = 0.0
     
     init(app: App, name: String) {
         self.app = app

    
    func add(x: Double, now: Double) {
        actionCost += x
        if has(timeLimit) {
            firstActed = firstActed ?? now
        }
    }
    
    func rest(lastActed: Double, now: Double) -> Double {

    }
    
    func expire() {
        errorLog?.info("expire")
        app?.expire()
    }
    
    func createExpireTimer() -> NSTimer {
        errorLog?.info("createExpireTimer")
        expire()
        return NSTimer.scheduledTimerWithTimeInterval(
            86400.0, target: self, selector: "expire", userInfo: nil, repeats: true)
    }

    func applicationDidFinishLaunching(aNotification: NSNotification) {
        root = "~/Library/Application Support/Ergometer".stringByStandardizingPath
        errorLog = ErrorLog(root: root)

        item = NSStatusBar.systemStatusBar().statusItemWithLength(/* NSVariableStatusItemLength */ -1)
        let prompt: String = kAXTrustedCheckOptionPrompt.takeUnretainedValue()
        let trusted = AXIsProcessTrustedWithOptions([prompt: true]) != 0
