added example 6, ex6.rb