change the data structure to graph and modify the merge function
Fix some bugs of merge
separate thing merge from merge
add hmm