adding option to write results to a JSON file instead of stdout