Added a cleverer merging strategy. Not working correctly yet.
Working merger tree (I think). Needs more testing.