union cpp output formulated and tested