added command line options, data can be read from stdin or command line.