Added a sieveSegment function.