Modify script to output JSON instead of JS