add io and improve lexer