Updated code with argparse.