added command-line mode