change references to stdout to result.stdout