Added dir output to eachd function