     // MARK: UIPageViewControllerDataSource
     func pageViewController(pageViewController: UIPageViewController, viewControllerAfterViewController viewController: UIViewController) -> UIViewController? {
         if let x = (pageViewControllers.indexOf { $0 === viewController }) {
-            if x < pageViewControllers.count { return pageViewControllers[x + 1] }
+            if x < pageViewControllers.count - 1 { return pageViewControllers[x + 1] }
         }
         return nil
     }
     
     func pageViewController(pageViewController: UIPageViewController, viewControllerBeforeViewController viewController: UIViewController) -> UIViewController? {
         if let x = (pageViewControllers.indexOf { $0 === viewController }) {
-            if x > 0 { return pageViewControllers[x + 1] }
+            if x > 0 { return pageViewControllers[x - 1] }
         }
         return nil
     }
     
     // MARK: DeviceSessionDelegate
-    func deviceSession(session: DeviceSession, finishedWarmingUp deviceId: DeviceId) {
-        // ???
-    }
-    
-    func deviceSession(session: DeviceSession, startedWarmingUp deviceId: DeviceId, expectedCompletionIn time: NSTimeInterval) {
-        // ???
-    }
-    
     func deviceSession(session: DeviceSession, endedFrom deviceId: DeviceId) {
         end()
     }

        pageViewControllers = ["devices", "sensorDataGroup", "classification"].map { pagesStoryboard.instantiateViewControllerWithIdentifier($0) as UIViewController }
        setViewControllers([pageViewControllers.first!], direction: UIPageViewControllerNavigationDirection.Forward, animated: false, completion: nil)
        
        startTime = NSDate()
        timer = NSTimer.scheduledTimerWithTimeInterval(1, target: self, selector: "tick", userInfo: nil, repeats: true)
    }

        viewControllers.foreach(updateMulti)
    }
    
}
