Completed part1.rb