second solution to ruby-0-2