now factorized a bit.  With a unit test even!
cleaned up a bit -- removed unnecessary command line argument names