Rewrote Lexer without regular expressions