adds the looping on the json idea