added command-line parsing