Implemented prime sieving