first solution for Ruby-0 challenge 7