rework "main program" and command line logic