added setoutput method which clears(also) the result stack; addoutput doesnt do that