added example 8, ex8.rb