             let index: String.UTF8Index
         }
 
-        struct RangeLinePair {
+        struct RangesAndLine {
             let range: NSRange
+            let byteRange: NSRange
             let line: Line
         }
 
         var byteOffsetIndexPairs = Dictionary<Int, ByteOffsetIndexPair>()
-        let rangeLinePairs: [RangeLinePair]
+        let rangesAndLine: [RangesAndLine]
         let utf8View: String.UTF8View
 
         init(_ string: NSString) {

    - parameter offset: byte offset.
    */
    public func lineAndCharacterForByteOffset(offset: Int) -> (line: Int, character: Int)? {
        return byteRangeToNSRange(start: offset, length: 0).flatMap { characterRange in
            return lineAndCharacterForCharacterOffset(NSMaxRange(characterRange))
        }
    }

    /**

        }

        var lines: [Line] {
            return rangesAndLine.map { $0.line }
        }

        func lineAndCharacterForCharacterOffset(offset: Int) -> (line: Int, character: Int)? {
            let index = rangesAndLine.indexOf { NSLocationInRange(offset, $0.range) }
            return index.map {
                let element = rangesAndLine[$0]
                return (line: element.line.index, character: offset - element.range.location + 1)
            }
        }
        
        func lineAndCharacterForByteOffset(offset: Int) -> (line: Int, character: Int)? {
            let index = rangesAndLine.indexOf { NSLocationInRange(offset, $0.byteRange) }
            return index.map {
                let element = rangesAndLine[$0]
                return (line: element.line.index, character: offset - element.range.location + 1)
            }
        }
    }
