Moved the dir-creation out of for loop, Script is much faster now