Adding comments to isDir method