almost working
working fine for one level of directories