Update main.rb

most of work is done