now results are written to json