moved directory creation outside loop to create classes.