Completed part3.rb