removed structs in the code, verified the results, added code to write out the merge tree into output files