modified to handle dresden subdirectories