almost done updating to getopt