better numbers and formulas for ruby script