move to getopt for argument parsing