migrated script to argparse