                 }
                 y += height + padding
             }
-            
+
+            if let range = lastEncodedTimeRange {
+                let x = (range.start - startTime) * secondWidth
+                let w = (range.end - startTime) * secondWidth
+                let rect = CGRect(x: x, y: 0, width: w, height: y)
+                CGContextSetStrokeColorWithColor(ctx, UIColor.redColor().CGColor)
+                CGContextStrokeRect(ctx, rect)
+            }
         }
         
         let context = UIGraphicsGetCurrentContext()
         if let sdg = sensorDataGroup {
             if let st = sdg.startTime {
                 drawLayer(context, sdg, st)
+                drawTimeGrid(context)
             }
         }
     }

        setNeedsDisplay()
    }
    
    override func drawRect(rect: CGRect) {
        func drawLayer(ctx: CGContextRef, sdg: SensorDataGroup, startTime: CFAbsoluteTime) {
            let height = 40.0
            let padding = 4.0
            let secondWidth = 20.0
            var y: Double = padding
            for (i, sda) in enumerate(sdg.sensorDataArrays) {
                for (j, sd) in enumerate(sda.sensorDatas) {

    }
    
    func mutliDeviceSession(session: MultiDeviceSession, continuousSensorDataEncodedBetween start: CFAbsoluteTime, and end: CFAbsoluteTime) {
        sensorDataGroupView.setLastEncodedTimeRange(TimeRange(start: start, end: end))
    }

}

class SensorDataGroupView : UIView {
    private var sensorDataGroup: SensorDataGroup?
    private var lastEncodedTimeRange: TimeRange?
    private let secondWidth = 20.0
    
    private let colors: [UIColor] = [
        UIColor(red: CGFloat(0.37), green: CGFloat(0.74), blue: CGFloat(0.95), alpha: CGFloat(1.0)),
        UIColor(red: CGFloat(0.33), green: CGFloat(0.44), blue: CGFloat(0.58), alpha: CGFloat(1.0)),
