added example 4, ex4.rb