merge merkle tree

- adding  PR for comments
This will lead to adding a statement in the "case of". So to preserve the size of code 3 element tuple has been used. But the return value of the function has tuple of size 2.