improved parser and lexer