Completed part2.rb