challenge 5 done in ruby