calculate merkle tree roots