added small lexer and cleaned up parser