Added argument parsing so that the script can perform different actions