polish.
now support reading from standard in and writing to standard out.