modified match.rb by passing object