Added a portion that checks to see if the output files already exist or not.