optparse, refinements of main()
cleanup