Update to use getopt