replaced optparse with argparse