Changed directory.rb to use methods