added command line execution logic