first solution to ruby-1 ex3