added directory processing functionality