added methods to directory.rb