fix binary tree left and right nodes calculation