Added command line args plus several other changes.
Tested optional list argument both ways.