Added all the data processing logic
Merging...