filled in factor arithmetic