improve print function and lexer function