added way to calculate prime factors