Updated exercise6.rb