Change to use getopt instead of getopts