Argparse module implementation

Added argparse to handle the command line arguments and clean up code