Fixed the lex-method