completed to ex30.rb