very roughly generating the json file