addition of output argument to save results to.