Fixed the first write. Closes and writes changes after data is written
Got addresses in setup rather than loop