added some command line functionality to main