finished the data retrieval and format writer process