improved how output is handled and tested.