first version of merge graph with unit test