Added reading directory functionality