class-up the script and add optparse options