Completed challenge 7 in ruby.