added some examples and fixed listDir for sub-directories