finish merge step
add some debug code. memory still not fully released even in very simple
example!
update