modified DirReader code