added the command line logic