Completed part6.rb