Switched to argparse module for parsing command line arguments, updated the different functions accordingly.