converted part of main.cpp to use mkdir