Now with a check for whether directories already exist