updated analyze.rb