Added improved number of divisors method