converted all of main.cpp to use mkdir() to create directories