Finished reduce. It now (untested) should return the result directly to the running program as a string