Added a new variable, new_root_dir, that is set if we created the