added checks to ensure that the directory doesn't already exist, and that files that do not start with a letter do not crash the program.