Re-wrote lexer