Updated to use argparse instead of manual parsing.