added prime generator with isPrime helper