This writes to csv