Finished most of the code to combine the data.