There will be one object, h, of class HAMM and this will do all of its work with one iterator, generate!. Much of the power of O-O languages comes from their libraries and Sather has an efficient queue container class based on arrays, called A_QUEUE{T}. The separate streams of answers for each prime seed are in: attr stream:ARRAY{A_QUEUE{INT}}; The create routine for HAMM takes as input the bound and an array of the primes greater than 1 to be used. Arrays define a function asize that is used here to initialize the attribute n and to create the correct size of stream array, which is then initialized with A_QUEUE{INT} objects. The bound, bd, is a good estimate for the initial size of each queue. The work is done by the generate! iterator and uses the standard algorithm as described in . The stream based on each prime is first initialized with that prime in the first loop. The main loop runs until all streams are empty. At each step it computes the minimum value not yet yielded and yields it. Since each stream is kept ordered, we need only test the "top" of each. When stream i becomes empty, the upper bound is enqueued on that stream and acts as an end marker. The complex loop following the yield updates the streams.The current output is multiplied by primes[i] and, if less than the bound, the product is enqueued on stream[i]. Next the top of the stream is discarded if it equals the current output; thus duplicates are eliminated at this point. Finally, we test to see if stream[i] is now empty and if so enqueue the bound. The driver code, main, just initializes the array of primes, creates one HAMM object, h, and asks it to generate! the answers. It turns out that the identical code is used in the basic parallel solution. There was no conscious effort to achieve this reuse, but we did know that the parallel version was just ahead.