broke main.rb into separate lib files