Added CountFactors method