Retooled to output JSON