copy results to output buffer