Added code for commandline processing