Added the prototype for a merging method
Implemented the required calls for the mergin mode