first version of dir.rb