working on subdirectory loop