use getopt() for argument parsing