added command line argument handling