 
 	func addToken(type: TokenType) {
 
-		let keywordLength = currentString.characters.count
-
-		let start = charIndex - keywordLength
+		let start = charIndex - currentStringLength
 		let end = charIndex
 		
 		let range: Range<Int> = start..<end

		let index = content.characters.index(content.startIndex, offsetBy: n)

		currentString += content.substring(to: index)
		charIndex += n
		content.removeCharactersAtStart(n)


		charIndex = 0

		currentString = ""
		currentStringLength = 0
		
		tokens = [Token]()

		var canDoExtraRun = true
