updated triangle.rb