Added some code taking commandline options.