switch to getopt