             }
             .subscribeNext { value in
                 self.startStopButton.setTitle("Start Timer", forState: .Normal)
-                self.timer?.invalidate()
-                self.timer = nil
+                self.rx_timer_disposable?.dispose()
+                self.rx_timer_disposable = nil
+                
                 self.targetDate = nil
                 self.cancelLocalNotifications()
                 self.totImage.transform = CGAffineTransformIdentity

    
    var totalNumberOfTots = Variable(5)
    var timerRunning = Variable(false)
    var timer: NSTimer?
    var targetDate: NSDate?
    var degrees = 0.0
    
    override func viewDidLoad() {
        super.viewDidLoad()

                self.refreshTotAndTimer()
                
                self.scheduleLocalNotification(self.targetDate!)
                
                self.rx_timer_disposable = Observable<Int>
                    .timer(1.0, period: 1.0, scheduler: MainScheduler.instance)
                    .subscribeNext({ seconds in
                        self.refreshTotAndTimer()
                    })
                self.rx_timer_disposable?.addDisposableTo(self.disposeBag)
                
                
                self.timerFace.hidden = false
                self.totCountStepper.hidden = true
