modified pin.rb