Updated generate_output.js. Now generates arrays of output given a JSON file