added code - ex4.rb