complete rewrite using argparse