merge.cpp code needs to be tested