updated code for simple json, fresh libraries