Sped up the prime calculations