added directory tree function