writing json, hopefully not repeating address searches