added command line arguments handling