Changed the way of iterating through the string in the Lexer.