minor optimization
store directory entries in sorted, minor optimization