Adding merge tree code into test.