Adding more efficient prime generator