prototype of the comparing function and also a raw merging function