Modified ex7.rb