added code for command-line arguments