Add functions and implement argparse