modified to use json/pure