         // The closing ".
         let _ = advance()
         
-        let cs = source.characters
-        let range = cs.index(cs.startIndex, offsetBy: start + 1)..<cs.index(cs.startIndex, offsetBy: current - 1)
-        let value = String(cs[range])
+        let range = source.index(after: start)..<source.index(before: current)
+        let value = source[range]
         addToken(.STRING, value)
     }
     
     private func match(_ expected: Character) -> Bool {
         if isAtEnd() { return false; }
-        let cs = source.characters
-        if cs[cs.index(cs.startIndex, offsetBy: current)] != expected { return false }
+        if source[current] != expected { return false }
         
-        current += 1
+        current = source.index(after: current)
         return true
     }
     
     private func peek() -> Character {
-        if current >= source.characters.count { return "\0" }
-        let cs = source.characters
-        return cs[cs.index(cs.startIndex, offsetBy: current)]
+        if current >= source.endIndex { return "\0" }
+        return source[current]
     }
     
     private func peekNext() -> Character {
-        if current + 1 >= source.characters.count { return "\0" }
-        let cs = source.characters
-        return cs[cs.index(cs.startIndex, offsetBy: current + 1)]
+        let next = source.index(after: current)
+        if next >= source.endIndex { return "\0" }
+        return source[next]
     }
     
     private func isAlpha(_ c: Character) -> Bool {

    }
    
    private func addToken(_ type: TokenType, _ literal: Any) {
        let cs = source.characters
        let startIdx = cs.index(cs.startIndex, offsetBy: start)
        let currentIdx = cs.index(cs.startIndex, offsetBy: current)
        let text = String(cs[startIdx..<currentIdx])
        tokens.append(Token(type, text, literal, line))
    }
}

    }
    
    private func isAtEnd() -> Bool {
        return current >= source.endIndex
    }
    
    private func scanToken() {
