arith in Ruby (fix bugs)