minor changes to ex6.rb to remove rubocop offenses