moving from getopt to optparse, and general cleanup