comment out debug output
update merge part of the function
fix bug on skipping nodes when merging some area