rewrite using argparse