Add check to see if file already exists in curr directory, reformat code