worked on json writing