first solution to ruby-0 challenge 6