Finished retrieveData function.