added ex40.rb