Made conditional statements more explicit and implemented argparse.