Use turbo mode, 5000 primes takes around 3 minutes to generate
Edit: I have edited the code to make it tons faster and it now only takes around