Adding argparse and fixed def main().